Posts

Showing posts from July, 2018

Spring Core - Different Types of Bean Injection

Image
1. Overview Dependency Injection is a very common technique in software engineering whereby an object supplies the dependencies of another object. Means that DI is about passing a dependency object to another a dependent object.
Assume we have a client and a service that would be used by the client. We pass the service to the client rather than allowing the client to build it. DI is commonly related to a wide known taxonomy which is Inversion of control aka IoC. But simply, IoC is a more general than the DI. IoC means letting the other code call you rather than insisting od doing the calling.
All of this is managed through the Spring Container which requires some sort of configurations that are presented through XML-based configuration or Annotation-based configuration. We will focus on the Annotation-based one in the below subjects.
2. Maven Configuration We need to make sure that Spring core and JUnited dependencies exists in our pom.xml
<properties> <!-- Spring --> &…