Softeq / XToolkit.WhiteLabel

Modular MVVM framework for fast creating powerful cross-platform applications with Xamarin & .NET for Mobile
https://softeq.github.io/XToolkit.WhiteLabel/
MIT License
25 stars 5 forks source link

IoC container extensions #503

Open TimofeyBurak opened 1 year ago

TimofeyBurak commented 1 year ago

Detailed Description

Currently, IContainerBuilder interface is our primary abstraction of an IoC container builder. It is used to register different parts of the XToolkit, including WhiteLabel itself. Currently, IContainerBuilder is a part of WhiteLabel project, and thus can be used only within WhileLabel project (WhiteLabel is registered as a part of Bootstrapper class). This means that all other projects don't know anything about the container they will be registered in, so it is developer's responsibilities to register all required parts in specific way manually in the production solution.

Context

500 has an example of complex push-notification services initialisation, which cannot be simplified with current approach. Also, it shows that currently WhiteLabel controls IoC container creation, even though it can be created (and filled) independently

Possible Implementation

If we move IContainerBuilder interface into XToolkit.Common project (or, alternatively, migrate into using Microsoft.Extensions.DependencyInjection) - it will allow each project implement a shortcuts for IoC container registrations. Even WhiteLabel initialisation can be implemented as an extension, thus further decoupling WhiteLabel with Bootstrapping and removing any interferences with 3-d party integrations

Basic Information

TimofeyBurak commented 1 year ago

Kudos to @vadimpylsky for the idea