spring--Opening (Spring pros and cons, module components, individual jar packages)

Source: Internet
Author: User

spring--opening Category: Ssh&ejb2012-11-23 15:25 4369 people read reviews (13) Favorite Report Javajavajavaspringspringwebwebweb framework

First, Introduction

The growing capabilities of spring and the integration of various technologies into the continuous version update have almost become the Queen's Framework for enterprise-level development, with the following seven modules in the development manual:

The core package is the most basic part of the framework and provides dependency injection (Dependency injection) to manage bean container functionality.

Context Package , built on the core package, provides a way to frame access to objects, some like Jndi registration. The context package inherits the functionality of the beans package and also adds internationalization (i18n), event propagation, resource loading, and transparent creation contexts, such as through a servlet container.

The DAO package provides a JDBC abstraction layer that eliminates lengthy JDBC encoding and resolves database vendor-specific error codes. Also, the JDBC package provides a better declarative transaction management approach than programmatic, not only for specific interfaces, but also for all pojos.

The ORM Package provides an integration layer for the popular "Relational/object" mapping APIs, including Jdo,hibernate and Ibatis. With an ORM package, you can mix the "object/relationship" mappings with all of the spring-provided features, such as the simple declarative transaction management mentioned earlier.

AOP Packages provide aspect-oriented programming implementations that conform to the AOP Alliance specification, such as method interceptors (method-interceptors) and Pointcuts (pointcuts), which logically weaken the functional coupling of the code and are clearly separated from each other.

Web Packages provide basic web-oriented features such as multi-party file uploads, IOC container initialization with servlet listeners, and ApplicationContext for the web. When using spring with webwork or struts, this package enables spring to be combined with other frameworks.

Web MVC provides a model-view-controller implementation of web-oriented applications. The spring MVC Framework does not simply provide a traditional implementation, it provides a clear separation model between the domain model code and the Web form. Also, other features of the spring framework can be used.

Second, the package structure

Since 3.0, the package structure has changed, each module independent out of a package, a clear division of labor, users can assemble the jar according to different requirements, instead of the whole Spring.jar into the project as before, the following take 3.2m1 as an example, briefly introduce the package structure of spring:

Spring-core.jar: Contains the basic core tool class of Spring framework, the other components of spring to use the class in this package, is the basic core of other components;

Spring-aop.jar: Aspect-oriented programming, providing AOP (aspect-oriented programming) implementation;

Spring-aspects.jar: Spring integrates Aspectjrt.jar, and can also use Aspectjrt.jar instead;

Spring-beans.jar: The underlying implementation of SPRINGIOC (Dependency injection), which is used by all applications, includes access to configuration files, creation and management of beans, and inversion of control/ All classes related to Dependencyinjection (IOC/DI) operations;

Spring-context.jar: Spring provides extended services on basic IoC capabilities, plus support for many enterprise-class services such as mail services, task scheduling, jndi positioning, EJB integration, remote access, Caching and the encapsulation of various view-layer frameworks;

Spring-context-support.jar: Extended support for Spring-context, including support for cache caches (Ehcache), JCA, JMX, mail Service (JavaMail, COS Mail), A class for Task Scheduler scheduling (Timer, Quartz).

Spring-asm.jar: ASM is a small, lightweight Java bytecode manipulation framework that makes it easy to build and transform Java code. Both Hibernate and Spring use ASM (asm at the bottom of the cglib) at the bottom.

Spring-expression.jar: Spring expression language;

Spring-instrument.jar: spring3.1 Proxy interface to the server

Spring-instrument-tomcat.jar: spring3.1 integration of Tomcat's connection pool;

Spring-jdbc.jar: Contains all classes that encapsulate the spring for JDBC data access;

Spring-jms.jar: Provides support classes for jms1.0.2/1.1;

Spring-orm.jar: Contains spring to extend the DAO feature set to support IBATIS, JDO, OJB, TopLink because Hibernate is already in its own package and is not included in the package now. Most of the classes in this jar file depend on the class in Spring-dao.jar, and you need to include the Spring-dao.jar package when using this package;

Spring-oxm.jar: Spring's support for OBJECT/XMI mapping allows you to switch back and forth between Java and XML;

Spring-struts.jar: Integration of struts support;

Spring-test.jar: Spring's simple encapsulation of test frameworks such as JUnit;

Spring-tx.jar: Provide support for the transaction;

Spring-web.jar: Contains the core classes required to use the spring framework when developing web apps, including classes that automatically load Webapplicationcontext features, struts and JSF integration classes, File upload support classes, Filter class and a large number of tool helper classes;

Spring-webmvc.jar: This jar file contains all the classes related to the Spring MVC framework. Contains Freemarker, JasperReports, Tiles, Velocity, and XSLT related classes for internationalization, labeling, Theme, view presentation. Of course, if your application uses a separate MVC framework, no classes in this jar file are required;

Spring-webmvc-portlet.jar: Springmvc enhancement, Support Portlet standard (jsr168/jsr286);

Via (if shown as initial)

Third, the pros and cons

Spring has a lot of advantages, the benefits of each function module are not the same, such as dependency reversal to promote loose coupling, to enhance the program extensibility, so that your beans are unified management, AOP technology separation and logic-independent system-level services, to enhance the cohesion of the program, as well as declarative transactions, The benefits of MVC and so on. In the final analysis, Spring's greatest advantage-solving the complexities of enterprise applications makes Java EE easy to use. This is also the spring developer's original intention is also the goal, so far I have only used the iceberg of spring, it is difficult to say its benefits, not to discover its shortcomings, the general feeling that the spring framework is worth owning.

spring--Opening (Spring pros and cons, module components, individual jar packages)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.