Category

Architecture

Composition Root and DI Containers

Before, read my other post explaining why this subject is so important. The idea around the Composition Root pattern is to create an assembly exclusively to register all the dependencies, the architecture will look like this: The CompositionRoot.dll references all the other projects, except the View (see the red arrow). Note that the View.dll (which…

Read More

Plugin Architecture with DI Containers

Before, read my other post explaining why this is so important. This architecture is about to make make each assembly register their own dependencies. The idea is to develop a class that receives the DI Container by parameter and register the dependencies in that container. This class is called by reflection from somewhere next to…

Read More

Where should I register my dependencies?

The Scenario: You are developing a system, applying the S.O.L.I.D concepts and de inversion of control principle, you decide to use dependency injection and some DI Container. The literature and the patterns tell us that the dependencies should be registered as close as possible to the entry point of an application, that is, usually the…

Read More