What is Spring?
I keep hearing about Spring and Java development. Spring is a lightweight Framework. Think of Spring as a framework of frameworks. Spring provides support to various other frameworks such as Struts, Hibernate, Tapestry, EJB, JSF, and more.
The Spring Framework is a structure where we find solutions to various technical problems. The Spring Framework comprises several Spring Modules such as IOC, AOP, DAO, Context, ORM, WEB MVC etc.
Spring allows a application developer to manage bean dependencies by using XML-based configuration. Spring also allows an alternative way to define beans and their dependencies. This method is a Java-based configuration. Unlike the traditional XML approach, Java-based configuration allows you to manage bean components programmatically. The result to make this happen was Spring Annotations. Check out the most widely used Spring Framework Annotations.
Check out our Spring Tutorials that use Spring version 5.
Benefits of Spring Framework
Spring Framework provides predefined templates for JDBC, Hibernate, JPA, and other technologies. The result of these templates is that you end up writing less code. Much of the basics is already included in the templates.
Spring Applications are loosely coupled because of dependency injection. To decouple Java components from other Java components the dependency to a certain other class should get injected into them rather that the class itself creating this object.
Dependency Injection (loose coupling) simplifies the process to test an application.
Spring framework is lightweight because of its Plain Old Java Object (POJO) implementation. The Spring Framework does not require the programmer to inherit any class or implement any interface.
The Dependency Injection (loose coupling) feature of the Spring Framework and support of other frameworks makes development of Java EE applications easier and quicker.
The Spring Framework provides abstraction to Java EE specifications such as JMS, JDBC, JPA and JTA.