Dependency Injection: Service Locator, Factory, Constructor Injection, DIC

There are different patterns that allow us to inject dependencies into the classes in order to create loosely-coupled code. Among them I will discuss about the most popular ones: the Service Locator pattern the Factory pattern Constructor/setter injection, Composition Root and DIC These patterns are used as a replacement for the new operation in a … Continue reading Dependency Injection: Service Locator, Factory, Constructor Injection, DIC