XToolkit.WhiteLabel icon indicating copy to clipboard operation
XToolkit.WhiteLabel copied to clipboard

IoC container extensions

Open TimofeyBurak opened this issue 3 years ago • 1 comments

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

  • Component which need this feature: PushNotifications, Remote, WhiteLabel
  • Version which need this feature: 8af5c6aa542c72bfc21679dd00d1c177e482517b

TimofeyBurak avatar Nov 14 '22 15:11 TimofeyBurak

Kudos to @vadimpylsky for the idea

TimofeyBurak avatar Nov 14 '22 15:11 TimofeyBurak