-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Feature: Add common DI engine adapters. #233
Comments
This relates to a conversation started in the reactiveui/website project. Instead of documenting the different approaches we probably should just provide adapters. |
Structure Map has been sunset |
SimpleInjectorDependencyResolver not works in real apps. After some investigations i found this issues:
//var window = (MainWindow)container.GetInstance<IViewFor<MainViewModel>>();
var window = new MainWindow();
window.ViewModel = container.GetInstance<MainViewModel>();
window.Show();
I don't have any workarounds for second issue. Can we use this DI container with ReactiveUI? |
@chuuddo Thanks for the comments. Might be worth moving this one into it's own issue. Also if you can maybe provide a small project with the issue it'll like Rodney's life easier. |
@chuuddo Looks like you've done better than a small demo :) But the issue may be better to link to yourPR. |
@glennawatson i added my comment to PR. |
Just looked at Autofac implementation. |
Thanks for the Simple Injector catch. It may not be compatible with ReactiveUI, I'll look at the findings and see if we can find a reasonable way to resolve it. Im confused why muttability matters? As long as you aren't registering elements after the container is built there shouldn't be any issue using Autofac. There is a link in the Autofac implementation explaining that you would have to explicitly rebuild the container. This puts the onus on the developer to know that they are deviating from the frameworks in ended use, and that they have to manage it themselves. Ninject is on the list of implementations, we just haven't gotten to it yet. I can add DryIoc. Thanks again for the detail! |
Mutability matters because of current implementation of ReactiveUI initialization. And it looks like this method missed in current AutofacDependencyResolver implementation. splat/src/Splat.Autofac/AutofacDependencyResolver.cs Lines 73 to 84 in d27b0b4
|
I plan on migrating an app to this implementation this week. If I have issues, I will update this implementation. I am explicitly calling the Splat and ReactiveUI initialization before I assign the container to splat. I haven't had any trouble with it so far. |
Provide another repo with some tests. Hope it will be useful.
|
Adding support for |
@glennawatson i can make a PR, but in #274 you want to keep RxUI out of Splat and i want to clarify do we need to add this tests at all. |
Any remaining tasks with this one @RLittlesII |
@glennawatson I believe you implemented the |
Sounds good, mark it as first timer with a label I guess. |
Is your feature request related to a problem? Please describe.
Add new NuGet packages for different DI engines, such as Autofac, SimpleInjector etc.
Describe the solution you'd like
Add under a NuGet Package scheme, such as Splat.DependencyInjection.SimpleInjector or something.
Describe suggestions on how to achieve the feature
A clear description to how to achieve the feature.
Gives users the chance to use popular DI engines.
Structure MapRelates to reactiveui/rfcs#14
The text was updated successfully, but these errors were encountered: