Skip to main content

Spring Framework Overview

                    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:
  1. class Employee{
  2. Address address;
  3. Employee(){
  4. address=new Address();
  5. }
  6. }
there is dependency between the Employee and Address (tight coupling). In the Inversion of Control scenario, we do this something like this:
  1. class Employee{
  2. Address address;
  3. Employee(Address address){
  4. this.address=address;
  5. }
  6. }
Thus, we can say  IOC makes the code  or part of the code  loosely coupled.
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.

Advantages of Spring Framework are:


1) Templates are predefined

Spring framework provides templates for struts,hibernate and  JDBC, JPA etc.  So there is no need to write specific framework or api  code. It hides the basic steps of these specific framework or api code.


2) Facility Loose Coupling

The  applications  developed in Spring framework considered to be  loosely coupled because of  the feature called IOC or say dependency injection.

3) Testing and maintenance are easy

Due to Dependency Injection applications developed in spring framework are  easier for testing and maintenance.

4) Lightweight

POJO implementation makes Spring framework to be considered as  lightweight .

5) Development is Faster

Due to the feature of dependency injection  and the facility to integrate with framework it helps developed faster delivery of applications.

6) Powerful abstraction

It provides powerful abstraction to JavaEE specifications such as JMS, JDBC, JPA and JTA.



Comments

Popular posts from this blog

Contructor In Java

Constructor in Java In Java, constructor is a block of codes similar to method. It is called when an instance of object is created and memory is allocated for the object. It is a special type of method which is used to initialize the object. Note:  It is called constructor because it constructs the values at the time of object creation. It is not necessary to write a constructor for a class. It is because java compiler creates a default constructor if your class doesn’t have any. Rules for creating java constructor There are basically two rules defined for the constructor. Constructor must  have the  same  name as its class name Constructor must not have return type Types of java constructors two types of constructors in java: Default constructor (no-arg constructor) Parameterized constructor Java Default Constructor A constructor is called “Default Constructor” when it doesn’t have any parameter. Syntax of default constructor: ...

Introduction To Spring Framework

                    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...

Java Basic Syntax

                                                Basic Syntax Of Java When we talk about Java program, it can be called as a collection of objects which can be called through methods. Let us now briefly look into  it. Object  − Objects in java behaviors and states . lets consider a example of dog: dog  class state includes its name, breed ,color  and has behavior wagging their tail, barking, eating. object  in  java  classed as  an instance of a java class.   Class  − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type supports.   Methods  − A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.   Instance Variables  − Eac...