Spring Tutorial
Here in this spring tutorial we will give in-depth concepts of Spring Framework with examples. Spring Framework was developed by Rod Johnson in 2003. Spring framework makes the enterprise application development easy and fast.
This Tutorial is helpful beginners and experienced persons.
Spring Framework Overview
Spring is a lightweight framework introduced by Rod Johnson in 2003 . It can also be integrated with other frameworks such as Hibernate, struts, EJB, JSF etc.Spring framework has the following modules s IOC, AOP, DAO, Context, ORM, WEB MVC etc. Let's try to understand the IOC and Dependency Injection first.
Inversion Of Control (IOC) and Dependency Injection
The design patterns that are used to remove dependency from the programming code. Which makes the code development easy to test and maintain. Let's try to understand the following code:- class Employee{
- Address address;
- Employee(){
- address=new Address();
- }
- }
- class Employee{
- Address address;
- Employee(Address address){
- this.address=address;
- }
- }
In Spring framework, IOC is a container and responsible to inject the dependency. We provide metadata to the IOC container either by XML file or annotation.
Let see the Advantage of Dependency Injection
- It makes the code loosely coupled , so that easy to maintain
- It makes the code easy to test.
Comments
Post a Comment