Replies: 1 comment 1 reply
-
|
This is atleast slightly similar to alternatives that have been discussed in similar threads previously, going away from 1 global generated implementation to several, or at the very least that codegen is scoped to individual projects, and then in some way dynamically routing the the relevant module/processor.. I have an issue here that references some of these discussions: #97 There is some fundamental difficulty here with trying to reconcile compile time decisions and runtime branching. Like there is some I'm assuming there is still 1 global We have some sample larger appllication samples that do span multiple projects. During v3 we added Finally, to get any further on this topic, I think we would need a PR with a simplified sample that has the issues people commonly see, and use that to drive the discussion forward. Until now there has been a lot of discussion and very little code, which perhaps leaves a little too much discussion to the imagination 😄 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Was just wondering, I have a situation where the layers define their own dependencies instead of everything fully on the outer layer.
For example:
This is done to allow also several integration and system tests to be configured and register the services and avoid having (near) duplicates of registrations on several places.
Currently noticing erros due to following two issues:
AddMediator(...)and the last one performing wins.I think I cannot work around the issues without some changes to the library, so was wondering if the library could evolve so that not a
Mediatorclass is generated but supplied by the library and that it expects to receive something like anIEnumerable<IMedatiorProcessor>.So a brain fart idea like:
Mediatoris made that receive anIEnumerable<IMedatiorProcessor>and message gets forwarded to the generatedMediatorProcessor.FrozenDictionaryor other thingsMediatorProcessorwhich is then registered with TryAdd.Could also perhaps have
MediatorProcessor, like theSendmethods, are also generated as extensions forMediatorwhich do an immediate forward to the type. Would mean the Mediator would have to expose the registered handlers, but also gives the capability to keep the link between the message and handler with going to implementation.This would allow the following where it currently causes issues:
Api layer - only needs to define what it needs itself enriched
Application
Should the API decide to put additional assemblies, like that of the application, than the
AddMediatorinAddApplicationwill not add everything for a second time due toTryAddusage.Beta Was this translation helpful? Give feedback.
All reactions