Need for Dependency Injection

Let us understand why do we need Dependency Injection As we all learned that DI is required since it provides loose coupling. Let’s see how this is needed in some scenarios by considering the below requirement Requirement : Client need to open the door, whenever it opens he wants the alarm to be activated,and whenever […]

Share this article on

Autowiring in spring

Autowiring is an easy way of doing dependency injection in Spring. Let’s see how we do dependency injection without autowiring Create Person.java package com.kb.autowiring1;   public class Person {         Car car;     public Car getCar() {         return car;     }     public void setCar(Car […]

Share this article on
< Previous