Spring Framework's rack package details Spring's benefits
Having just built an MVC framework, I decided to share some of the things I learned during my build. I think whether you are a junior programmer or a senior programmer or a software architect, the first thing you should know when learning and understanding a framework is the principle of the framework and its role and relationship with the jar. This article summarizes the relevant knowledge of the spring framework.
I.introduction of SPIRNG ( master can skip )
Spring is an open source framework that is created by Rod Johnson. It is created to address the complexities of enterprise application development. Spring uses basic JavaBean to accomplish things that were previously only possible by EJBS. However, the use of spring is not limited to server-side development. From the standpoint of simplicity, testability, and loose coupling, any Java application can benefit from spring.
Second, how spring Works (MVC)
1.SPRINGMVC Please submit all requests to Dispatcherservlet, which will delegate the other modules of the application system responsible for the actual processing of the request.
2.DispatcherServlet queries one or more handlermapping to find the controller that handles the request.
3.DispatcherServlet request Submit to target Controller
4.Controller after the business logic is processed, it returns a Modelandview
5.Dispathcher querying one or more viewresolver view resolvers, locating the View object specified by the Modelandview object
6. The View object is responsible for rendering back to the client.
Third, the role of spring
AOP allows developers to create non-behavioral concerns, called crosscutting concerns, and insert them into application code. With AOP, public services (such as logs, persistence, transactions, and so on) can be decomposed into facets and applied to domain objects without increasing the complexity of the object model of the domain object.
IOC allows you to create an application environment where objects can be constructed, and then pass their collaboration objects to those objects. As the word inversion shows, the IOC is like the reverse jndi. Not using a bunch of abstract factories, service locators, single elements (singleton), and direct constructs (straightconstruction), each object is constructed with its collaboration objects. Therefore, the collaboration object (collaborator) is managed by the container.
Spring even an AOP framework, is also an IOC container. The best part of Spring is that it helps you replace objects. With spring, you simply add dependencies (collaboration objects) with the JavaBean property and configuration file. You can then easily replace collaboration objects with similar interfaces when you need them.
The Spring framework is a layered architecture consisting of 7 well-defined modules. The spring modules are built on top of the core container, and the core container defines how the beans are created, configured, and managed, as shown in 1.
Each module (or component) that makes up the Spring framework can exist separately or be implemented in conjunction with one or more other modules. The functions of each module are as follows:
Core container: The core container provides the basic functionality of the spring framework. The main component of the core container is Beanfactory, which is the implementation of the factory pattern. The beanfactory uses the inversion of control (IOC) pattern to separate the application's configuration and dependency specifications from the actual application code.
Spring Context: The spring context is a configuration file that provides contextual information to the spring framework. The spring context includes enterprise services such as JNDI, EJB, e-mail, internationalization, checksum scheduling.
Spring AOP: With the configuration management feature, the Spring AOP module directly integrates aspect-oriented programming capabilities into the spring framework. Therefore, it is easy to enable any object managed by the Spring framework to support AOP. The spring AOP module provides transaction management services for objects in spring-based applications. By using Spring AOP, you can integrate declarative transaction management into your application without relying on EJB components.
The Spring Dao:jdbcdao abstraction layer provides a meaningful exception hierarchy that can be used to manage exception handling and error messages thrown by different database vendors. The exception hierarchy simplifies error handling and greatly reduces the number of exception codes that need to be written (such as opening and closing connections). Springdao's JDBC-oriented exception conforms to the common DAO exception hierarchy.
The Spring orm:spring Framework inserts several ORM frameworks, providing ORM object-relational tools, including JDO, Hibernate, and IBatis SQL Map. All of these conform to Spring's common transaction and DAO exception hierarchies.
Spring Web module: The Web context module is built on top of the application context module and provides the context for Web-based applications. Therefore, the Spring framework supports integration with Jakarta struts. The Web module also simplifies the process of working with multipart requests and binding request parameters to domain objects.
Spring MVC framework: The MVC Framework is a full-featured MVC implementation of building WEB applications. With the policy interface, the MVC framework becomes highly configurable, and MVC accommodates a large number of view technologies, including JSP, Velocity, Tiles, IText, and POI.
The functionality of the Spring framework can be used in any Java EE server, and most features are also available in an out-of-management environment. The core point of spring is to support reusable business and data access objects that are not tied to a particular Java EE service. There is no doubt that such objects can be reused across different Java EE environments (web or EJB), standalone applications, and test environments.
Iv. Description of Spring Rack Package catalogue
The ASPECTJ directory is the source code and test program files for using ASPECTJ under the spring framework.
ASPECTJ is the earliest Java application framework to provide AOP.
The Dist directory is the spring release package, which is described in more detail below in the release package.
The docs directory is related to the documentation, including the Spring API Javadoc, reference Reference Guide, spring's tag library usage files, and spring MVC's mvc-step-by-step tutorials and examples. is a very good document, it is worth a good study.
The Lib directory is the third-party open source package that spring relies on.
The mock directory is the mock source program for the Spring Auxiliary application test.
The Samples directory is a sample configuration of Spring's sample source program and a simple WebApp example framework, which is worth studying Jpetstore and petclinic, and of course other countries, Imagedb, tiles-example can also be a good reference.
The SRC directory is the source program for spring.
The Unit test source program for spring under the test directory.
The Tiger directory is for source programs and test programs that use Java 1.5 in the spring framework. Tiger is the development code for JDK version 1.5.
Five, Spring rack package work role
Spring.jar is a single jar package that contains a complete release module. But not including Mock.jar, Aspects.jar, Spring-portlet.jar, and Spring-hibernate2.jar.
Spring-src.zip is all the source code compression package.
In addition to the Spring.jar file, Spring includes 21 other separate jar packages, each containing a corresponding Spring component, which allows the user to choose to assemble their own jar packages, rather than having to introduce all of the Spring.jar's class files.
Spring-core.jar (required)
This jar file contains the basic core tool classes of the spring framework. The other components of Spring use the classes in this package, which is the basic core of the others, and of course you can use them in your own application system.
Externally dependent Commons Logging, (log4j).
Spring-beans.jar (required)
This jar file is used by all applications and contains all classes that access the configuration file, create and manage beans, and perform inversion of control/dependency injection (IOC/DI) operations. If the application requires only basic Ioc/di support, the introduction of Spring-core.jar and Spring-beans.jar files is possible.
Externally dependent Spring-core, (CGLIB).
Spring-aop.jar (required)
This jar file contains the class and source-level metadata support required to use spring's AOP features in your app. Using the spring features based on AOP, such as declarative transaction management (declarative Transaction Management), also include this jar package in your application.
Externally dependent Spring-core, (Spring-beans,aop Alliance, Cglib,commons Attributes).
Spring-context.jar (required)
This jar file provides a number of extensions to the spring core. You can find all the classes you need to use the Spring ApplicationContext feature, Jdni all the classes you need, instrumentation components, and related classes for validating validation.
Externally dependent Spring-beans, (SPRING-AOP).
Spring-dao.jar (required)
This jar file contains all the classes of Spring DAO, spring Transaction for data access. In order to use declarative transaction support, you also need to include Spring-aop.jar in your own application.
Externally dependent Spring-core, (SPRING-AOP, Spring-context, JTA API).
Spring-jdbc.jar (required)
This jar file contains all the classes that encapsulate spring's JDBC data access.
Externally dependent Spring-beans,spring-dao.
Spring-support.jar (required)
This jar file contains classes that support UI templates (Velocity,freemarker,jasperreports), mail services, scripting Services (JRuby), cache caches (EHCache), Task Scheduler scheduling (Uartz).
Externally dependent Spring-context, (SPRING-JDBC, Velocity, Freemarker, JasperReports, BSH, Groovy, JRuby, Quartz, EHCache)
Spring-web.jar (required)
This jar file contains the core classes required to use the spring framework when developing Web applications, including classes that automatically load Web application Context features, Struts and JSF integration classes, File upload support classes, Filter classes, and a large number of tool helper classes.
Externally dependent Spring-context, Servlet API, (JSP API, JSTL, Commons FileUpload, COS).
Spring-webmvc.jar
This jar file contains all the classes related to the Spring MVC framework. Includes framework for SERVLETS,WEB MVC Framework, controller and view support. Of course, if your app uses a stand-alone MVC framework, you don't need any classes in this jar file.
Externally dependent Spring-web, (spring-support,tiles,itext,poi).
Spring-portlet.jar
Spring's own implementation of a framework similar to spring MVC. Includes an MVC framework and controller.
External dependent spring-web, Portlet API, (SPRING-WEBMVC).
Spring-struts.jar
Struts framework support makes it easier and easier to integrate the struts framework.
Externally dependent spring-web,struts.
Spring-remoting.jar
This jar file contains classes that support EJBS, remotely invoke remoting (RMI, Hessian, Burlap, Http Invoker, Jax-RPC).
External dependent SPRING-AOP, (SPRING-CONTEXT,SPRING-WEB,HESSIAN,BURLAP,JAX-RPC,EJB API).
Spring-jmx.jar
This jar package provides support classes for JMX 1.0/1.2.
Externally dependent SPRING-BEANS,SPRING-AOP, JMX API.
Spring-jms.jar
This jar package provides support classes for JMS 1.0.2/1.1.
Externally dependent SPRING-BEANS,SPRING-DAO,JMS API.
Spring-jca.jar
Support for JCA 1.0.
Externally dependent Spring-beans,spring-dao, JCA API.
Spring-jdo.jar
Support for the JDO 1.0/2.0.
Externally dependent SPRING-JDBC, JDO API, (spring-web).
Spring-jpa.jar
Support for JPA 1.0.
Externally dependent SPRING-JDBC, JPA API, (spring-web).
Spring-hibernate2.jar
Support for Hibernate 2.1 is not recommended for use.
Externally dependent Spring-jdbc,hibernate2, (spring-web).
Spring-hibernate3.jar
Support for Hibernate 3.0/3.1/3.2.
Externally dependent spring-jdbc,hibernate3, (spring-web).
Spring-toplink.jar
Support for the TopLink framework.
Externally dependent Spring-jdbc,toplink.
Spring-ibatis.jar
Support for Ibatis SQL maps.
Externally dependent Spring-jdbc,ibatis SQL Maps.
The other two packages.
Spring-mock.jar
This jar file contains the spring set of mock classes to aid in the testing of the application. The Spring test suite uses a large number of these mock classes, which makes testing easier. Simulating the HttpServletRequest and HttpServletResponse classes is convenient for Web application unit testing. And it provides support for JUnit.
Externally dependent Spring-core.
Spring-aspects.jar
Provides support for ASPECTJ so that aspect-oriented features can be easily integrated into the IDE, such as Eclipse AJDT.
External dependencies.
WEAVER JARS (dist/weavers) description.
Spring-agent.jar
Spring's instrumentationsavingagent (for Instrumentationloadtimeweaver), a device agent package, can refer to JDK1.5 's instrumentation features for more information.
External dependent none (for use at JVM Startup: "-javaagent:spring-agent.jar").
Spring-tomcat-weaver.jar
Extend the ClassLoader of Tomcat so that it can use the instrumentation (device) class.
External dependent none (for deployment into Tomcat ' s "server/lib" directory).
Reprint: http://java-ahz.iteye.com/blog/1722976
Spring.jar is a single jar package that contains a full release, with the exception of the Spring.jar? The contents of all the other jar packages contained in the Spring-mock.jar, because only in the development environment will use the Spring-mock.jar to carry out the auxiliary testing, the formal application system is not used in these classes. In addition to the Spring.jar file, Spring includes 13 other separate jar packages, each containing a corresponding spring component, which allows the user to choose to assemble their own jar packages, rather than having to introduce all of the Spring.jar's class files. (1)? Spring-core.jar This jar file contains the basic core tool classes of the spring framework, and the other components of the spring are used in the class of the package, the basic core of other components, and of course you can use these tools in your own application system. |
|
(2) Spring-beans.jar
This jar file is used by all applications and includes access to configuration files, creation and management of beans, and inversion?of. Control?/? Dependency? All classes related to the injection (IOC/DI) operation. If the application requires only basic Ioc/di support, the introduction of Spring-core.jar and Spring-?beans.jar files is possible.
(3) Spring-aop.jar
This jar file contains the classes required to use the Spring AOP feature in your app. Use the spring features based on AOP, such as declarative transaction management (declarative? Transaction? Management), also include this jar package in your application.
(4) Spring-context.jar
This jar file provides a number of extensions to the spring core. Can I find the use of spring? The ApplicationContext attribute is required for all classes, Jdni required for all classes, UI aspects to be used with the template (templating) engine such as? Velocity, Freemarker, JasperReports integrated classes, and related classes for validating validation.
(5) Spring-dao.jar
Does this jar file contain spring? DAO, Spring? Transaction all classes that perform data access. In order to use declarative transaction support, you also need to include Spring-aop.jar in your own application.
(6) Spring-hibernate.jar
This jar file contains all of the classes that spring encapsulates for hibernate?2 and hibernate?3.
(7) Spring-jdbc.jar
This jar file contains all the classes that encapsulate spring's JDBC data access.
(8) Spring-orm.jar
This jar file contains spring to extend the DAO feature set so that it supports the 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 Spring-dao.jar class, you need to include the Spring-dao.jar package when using this package.
(9) Spring-remoting.jar
This jar file contains support for EJB, JMS, Remote call Remoting (RMI, Hessian, Burlap, Http?). Invoker, Jax-RPC).
) Spring-support.jar
(one) Spring-web.jar
This jar file contains the core classes required to use the spring framework when developing Web applications, including classes that automatically load the Webapplicationcontext attribute,struts and JSF integration classes, File upload support classes, the filter class, and a large number of tool helper classes.
(Spring-webmvc.jar)
Does this jar file contain spring? All classes related to the MVC framework. Includes internationalization, labeling, Theme, Freemarker, JasperReports, Tiles, Velocity, and the view presentation? XSLT-related classes. Of course, if your app uses a stand-alone MVC framework, you don't need any classes in this jar file.
(Spring-mock.jar)
This jar file contains the spring set of mock classes to aid in the testing of the application. The Spring test suite uses a large number of these mock classes, which makes testing easier. Simulating the HttpServletRequest and HttpServletResponse classes is convenient for Web application unit testing.
How to choose these packages and decide which ones to use is fairly straightforward. If you're building a web app and will be using spring all the way, it's best to use a single, all-in-one Spring.jar file, and if your app uses just simple inversion?of? Control?/? Dependency? Injection (IOC/DI) container, then just Spring-core.jar and Spring-beans.jar, if you have a high size of the publication, then you have to select the selection, only the jar file containing the features you need. With a standalone release package you can avoid including all classes that your app doesn't need. Of course, you can use other tools to make the entire application package smaller, and the space-saving focus is to pinpoint the spring dependent classes you need, and then merge the required classes and packages. Eclispe has a plugin called? ClassPath? Helper can help you find the classes you depend on.
Reprint: http://blog.csdn.net/nszkadrgg/article/details/11840653
Spring Framework Package analysis, function, benefits, and jar Rack Package Introduction