-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstractions to support other dependency injection providers? #10
Comments
It's probably possible, as you say the analysis part is likely to be unchanged, so all the changes would basically be in the codegen templates. For example the options attribute there uses the I'm not 100% sure what the best design would be here, creating common denominator abstractions around lifetime and service location/DI or just create a base template that is included and augmented in a Overall I think it's a good idea, and the reason I haven't done anything about it was for simplicity sake since I'm not currently using anything other than the built in DI, so I'll probably look into this next time I'm working on this. Let me know if you want some input on your implementation and feel free to link it 😄 |
@martinothamar - Many thanks for your reply. I'll also take a look over the Mediator source code to see if there is a neat way to build in the extension point. I'm conscious that writing multiple implementations would significantly increase the project scope, but it would be great if it can be done in a way which permits additional community implementations without increasing your maintenance burden! |
…ection Container
I have pushed working proof of work for Jab DI container on my branch. Additionally - I affraid that it is not possible to make these two generators works gracefully together when dotnet/roslyn#57239 is not finished. |
…rFallback.sbn-cs
I note that in the documentation you state that:
Have you considered structuring the library in such a way that use with alternative abstractions would be possible (if not supported currently)? This would allow extensions to be written to support additional DI containers.
The reason I ask is that I am also in the process of writing a mediator library using source generators, but am not nearly as far along in my endeavors. It is my intention to support compile-time DI containers such as StrongInject, Jab and Pure.DI.
Much of the logic would be shared between the implementations (e.g. analyzing the client code to collect information about all the registered handlers and pipeline behaviors), but would differ primarily in the source which is then generated from the collected information.
The text was updated successfully, but these errors were encountered: