官术网_书友最值得收藏!

  • Mockito for Spring
  • Sujoy Acharya
  • 455字
  • 2021-07-23 20:37:59

Exploring the Spring architecture

Spring Framework is modular, and its features are organized into different modules. This section talks about core Spring modules. The following are the Spring 4 modules:

The core container

The core container holds the backbone of Spring Framework. The following are the submodules in the core container:

  • Core and Beans: These provide the fundamental parts of the framework, including IoC and dependency injection features
  • Context: This is a means to access objects in a framework-style manner that is similar to the JNDI registry
  • Expression Language: This is also known as SpEL; it is an expression language used to query and modify an object graph and evaluate mathematical expressions

The AOP module

AOP is an aspect-oriented programming implementation of Spring. It decouples the business logic from the cross-cutting infrastructure code, such as logging and security.

The instrumentation module

The instrumentation module provides class instrumentation support for the Spring application. Instrumentation exposes container resources through MBean and helps in JMX management.

The messaging module

The messaging module comes with key abstractions from the Spring Integration project such as Message, MessageChannel, and MessageHandler to serve as a foundation for messaging-based applications.

The data access module

The following are the submodules in the data access module:

  • JDBC: This provides a JDBC abstraction layer
  • ORM: This provides integration layers for popular object-relational mapping APIs, including JPA, JDO, Hibernate, and iBATIS
  • OXM: This provides an abstraction layer that supports object/XML mapping implementations for JAXB, Castor, XMLBeans, JiBX, and Xstream
  • JMS: This contains features to produce and consume messages
  • Transactions: This supports programmatic and declarative transaction management

The web layer

The web layer consists of the web, webmvc/servlet, WebSocket, and webmvc-portlet modules:

  • Web: This module provides basic web-oriented integration features such as multipart file upload functionality and initialization of the IoC container using servlet listeners and web-oriented application context. It also contains the web-related parts of Spring's remoting support.
  • Webmvc: This module (also known as the web-servlet module) contains Spring's model-view-controller implementation for web applications. Spring's MVC framework provides a clean separation between the domain model code and web forms and integrates with all the other features of Spring Framework.
  • Portlet: This module (also known as the web-portlet module) provides the MVC implementation to be used in a portlet environment and mirrors the functionality of the webmvc module.
  • WebSocket: This module provides APIs for two-way communication between client and server. It is extremely useful when the client and server need to exchange events at high frequency and low latency. Prime candidates include applications in finance, games, collaboration, and so on.

The test module

The test module supports the unit testing and integration testing of Spring components with JUnit or TestNG.

The following figure represents the Spring 4 modules:

The test module
主站蜘蛛池模板: 张家港市| 将乐县| 青川县| 开封市| 郯城县| 青河县| 辽中县| 中西区| 迁西县| 定结县| 东乌珠穆沁旗| 句容市| 扎赉特旗| 仁化县| SHOW| 大悟县| 阜平县| 泗水县| 蓝田县| 和林格尔县| 云南省| 城步| 西盟| 宝清县| 荆州市| 大方县| 大港区| 兰坪| 鱼台县| 九龙城区| 株洲县| 津市市| 云安县| 桓仁| 黎川县| 咸阳市| 扎囊县| 尼玛县| 喀喇沁旗| 红安县| 高州市|