What is Spring? What are the features in Spring Framework?

-->

What is Spring?

Spring is a Java based open source framework. It is light weight, loosely coupled, aspect oriented framework. We can develop standalone applications, web applications, distributed applications and enterprise applications & etc using spring framework.

What are the features in Spring Framework?

1. Supports POJO and POJI
2. Light weight
3. Builtin middleware services
4. Dependency Injection
5. Unit Testing
6. Builtin plugins
7. All kind of applications
8. Supports web framework
9. ORM

1. Supports POJO and POJI

POJO – Plain Old Java Object

POJO means Plain Old Java Object. If a java class is not extending or implementing predefined classes or interfaces of Spring API then its called as POJO. Spring framework supports POJO.

Example

// Test is a POJO 
Public class Test {

}

// Test is a POJO because Demo class is user defined class
Public class Test extends Demo {

}

// Test is not a POJO because Test Class extends framework class
public class Test extends HttpServlet {

}

POJI – Plain Old Java Interface

POJI means Plain Old Java Interface. If a interface is not extending predefined interface of Spring API then its called as POJI. Spring framework supports POJI.

Example

// Test is a POJI
public interface Test {

}

// Test is not a POJI because Test interface extends framework interface
public interface Test extends java.rmi.Remote { 

}

2. Light Weight

Spring framework supports POJO and POJI. Most of the spring applications can be executed without heavy weight Web server/Application Server. Spring framework comes with modular approach. Spring framework as a whole is divided into various modules such as Spring Core, Spring JDBC, Spring MVC, Spring Data,Spring ORM, etc. whichever you want and just include library into the project classpath. For example, since you can use Spring JDBC without using Spring MVC.

3. Builtin middleware services

Spring framework gives built-in middleware services, it allows to work with server managed and third party middle-ware services. Spring gives new methodology called AOP to apply middleware services.

3. Dependency Injection

Spring framework supports both dependency injection and dependency look up. It supports the loose coupling between the objects. Dependency Injection is a core design pattern of Spring framework on o which dependency of object is injected by framework rather than created by Object itself. One of the implementation of DI is Inversion of Control (IOC) on which framework like Spring controls object’s dependency. There are mainly two types of Dependency Injection: Constructor Injection and Setter Injection.

5. Unit Testing

Spring framework provides environment to perform unit testing integration testing and on applications.

6. Builtin plugins

Spring framework provides built-in plugins to make spring application to integrate with other java technology based applications.

7. All kind of applications

Spring framework allows to develop all kind of applications like standalone application, web application, distributed application and enterprise applications & etc. we can develop all kind logic like application logic, business logic, persistence logic and presentation logic using spring framework.

8. Supports web framework

Spring framework gives its own framework Spring MVC to develop MVC architecture based web applications.

9. ORM

Spring framework provide the abstraction layer on other framework like Hibernate, iBatics and etc. It supports to integrate java based framework with spring.