Basic knowledge of spring framework

Basic knowledge of Spring Framework


Introduction to the Spring Framework

Spring, an open source framework created by Rod Johnson. Spring was created to solve the complexity of enterprise application development, can make a simple JavaBeans / POJO to complete the matter that before only can complete by EJB[1]. Spring provides a large number of APIs to simplify integration with other third-party frameworks.

Looking at Spring, you will find that Spring can solve a lot of problems, but in the final analysis, all Spring provides API/solution ideas can be traced back to Spring's most fundamental concept of "simplified Java development."

▲Spring = simplified Java development

Spring strategy and core

The four key strategies/core that Spring to reduce the complexity of Java development

1. POJO-based lightweight and minimal invasive programming

2. Loosely coupled by dependency injection and interface-oriented

3. Declarative programming based on aspect and convention

4. Reduce the board code by aspect and template

All of the Spring APIs / solutions can be traced back to one or more of the above strategies.

Spring shortcomings

Although Spring can reduce the complexity, but when Spring begins to the current version 4.X, Spring is already a very complex framework. 

And the Spring original goal is a lightweight container framework, but when Spring begins to the current version 4.X, is also a heavyweight framework. 

Finally, although Spring is the smallest invasive, but it gives us the greatest dependency. 

Spring module

Core module

spring-core,spring-beans : the most basic module of the Spring , which provides IOC and dependency injection and other functions

spring-context : Provides a context object that accesses an object

spring-context-support : Provides the ability to integrate the third-party library into a context

spring-expression(SPEL) : Provides powerful expression language support to reduce workload

AOP module

spring-aop : Provides a AOP-compliant aspect-oriented API implementation

spring-aspects : Provides integration with AspectJ

Data access integration module

spring-jdbc : Provides APIs for simplify JDBC programming

spring-tx : Provides APIs for simplify transaction management and programming

spring-orm : Provides APIs for simplify ORM specification[2] programming and provides support for JPA, Hibernate

spring-oxm : Provides APIs for simplify the OXM specification[3] programming

spring-jms : Provides APIs for simplify JMS specification[4] programming

Web module

spring-web : Provides APIs for simplify the programming of basic Web functions

spring-webmvc,spring-webmvc-portlet : Provides APIs for simplify MVC[5] and RESTful[6] programming

spring-websocket : Provides APIs for simplifying Websocket writing

Test module

spring-test : Provides components for unit testing and integration testing support, simplifies the test case programming API

Messaging module

spring-messaging : Supports message architecture and protocols

Instrumentation module

spring-instrument : Provides class detection support and class loader implementation for use in some application servers

spring-instrument-tomcat : Provides class checking support and class loader implementation for use in Tomcat

Spring framework overview

Spring framework overview



[1]Here EJB refers to the EJB2.X, because from the EJB3.X specification can also use POJO to achieve EJB specification.

[2]Object relational mapping, used to map the objects represented by the object model to the SQL-based relational model database structure.

[3]Object XML Mapping, mapping between data entity objects and XML nodes.

[4]Java message service, a member of the JavaEE specification, responsible for interacting with information middleware (MOM). Reference:Basic knowledge of JavaEE standard

[5]MVC is a model that uses MVC (Model View Controller Model – View – Controller) to design a Web application.

[6]RESTful a software architecture style.

Leave a Reply