Skip to content
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

Issue with docs/handbook/dependency-inversion/index.md #292

Open
dimacurotech opened this issue Feb 4, 2019 · 9 comments
Open

Issue with docs/handbook/dependency-inversion/index.md #292

dimacurotech opened this issue Feb 4, 2019 · 9 comments

Comments

@dimacurotech
Copy link

It is absolutely unclear how to register/start using Splat within Xamarin.Forms. Simply registering interfaces+implementations within Splat's Locator.CurrentMutable does not make Splat a default DI container.

@glennawatson
Copy link
Contributor

Splat is everywhere throughout reactiveui code base. So we make calls to splat to determine which views or adapters are used. You have no choice in some capacity to use Splat but we are starting to add DI adapters to allow it to talk to other engines

@dimacurotech
Copy link
Author

dimacurotech commented Feb 5, 2019

I guess this talk does not give a clear reference to an article, so here it is: https://reactiveui.net/docs/handbook/dependency-inversion/

ReactiveUI is a composable, cross-platform model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming which is a paradigm that allows you to express the idea around a feature in one readable place, abstract mutable state away from your user interfaces and improve improve the testability of your application.

@glennawatson
Copy link
Contributor

Thanks for the feedback something we can make more explicit for sure

@dimacurotech
Copy link
Author

dimacurotech commented Feb 5, 2019

@glennawatson What I ment was that it is completely unclear how to integrate Splat into a new Xamarin.Forms project.
Such a project uses Xamarin.Forms.DependencyService as a default service locator.
So the key question here is: how to make Splat a default Service locator?

The article shows how to register services and how to manually resolve them. But will ReactiveUI resolve them automatically after that? Or should we take another step?

Maybe we do not need that another step and can use Splat side by side with Xamarin.Forms.DependencyService?

@glennawatson
Copy link
Contributor

You can definitely work side by side with it. We are adding a bunch of DI engine adapters to Splat at the moment so might add to the list the Xamarin.Forms.DependencyService as an adapter.

What this does is makes Splat's backing store for the values whatever DI engine is used in the adapter.

@dimacurotech
Copy link
Author

dimacurotech commented Feb 5, 2019

Do you plan to add IServiceCollection (for registration) and IServiceProvider (to resolve) from Microsoft.Extensions.DependencyInjection?

@RLittlesII
Copy link
Member

I am wondering what the desire is to have a web DI Adapter for a UI framework that targets desktop and mobile? Not saying that we shouldn't or won't do it, I am just trying to understand the sell. Is WPF going to be wiring into the same abstractions? The framework currently sits under asp.net which is not a framework we support at the moment.

@glennawatson
Copy link
Contributor

Some people use it in web frameworks (eg Geoffrey Huntley has used it in this case).

@dimacurotech
Copy link
Author

dimacurotech commented Mar 12, 2019

Sorry for late reply - I've been busy with another project.
@RLittlesII, it is really strange why Microsoft.Extensions.DependencyInjection.Abstractions sits under asp.net, but it provides a great standard for different libraries, since many libraries already provide extensions for IServiceCollection.

I wouldn't drop Microsoft.Extensions.DependencyInjection.Abstractions just because it sits under asp.net, not under something else.

On the other hand: if it does not suit ReactiveUI because of technical reasons - than of course it should not be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants