Spring Introduction


Spring is a smaller framework with several features and is also referred to as a framework of frameworks as it supports multiple frameworks, including Hibernate, Struts, EJB, Tapestry, JSF, and others. In a larger sense, the framework can be regarded as a structure in which we discover solutions to diverse technical difficulties.

The Spring framework includes IOC, AOP, DAO, Context, ORM, WEB MVC, and other modules.

The Spring Framework's Advantages

The following summarizes some of the many advantages of using Spring Framework.

  • Spring is set up in a modular format. Despite many packages and classes available, you only need to worry about the ones you require and ignore the rest.
  • Using POJOs, Spring allows developers to create enterprise-class apps. The advantage of using POJOs solely is that you don't need an EJB container like an application server; instead, you can use a robust servlet container like Tomcat or a commercial offering.
  • Spring does not reinvent the wheel; rather, it makes extensive use of existing technologies such as ORM frameworks, logging frameworks, JEE, Quartz, and JDK timers, as well as other view technologies.
  • Because environment-dependent code is placed into this framework, testing an application created with Spring is trivial. Furthermore, leveraging JavaBeanstyle POJOs makes dependency injection for inserting test data much easy.
  • Spring's web framework is a well-designed web MVC framework that is an excellent alternative to over-engineered or less popular web frameworks like Struts.
  • Spring provides a simple API for converting technology-specific exceptions (such as those thrown by JDBC, Hibernate, or JDO) into unchecked, consistent exceptions.
  • IoC containers are typically light, especially when compared to EJB containers. This is useful for creating and distributing apps on computers with limited memory and processing power.
  • Spring provides a consistent transaction management interface that may scale up to global transactions and down to local transactions (using a single database, for example) (JTA, for example).