Spring Learning "Spring Overview"

Source: Internet
Author: User
Tags to domain

Starting with this article, we're going to learn the spring framework together, and first we have to say that the spring framework is an excellent open source framework. The idea of configuration management and AOP based on the IOC principle is well worth learning and using in Java beans. Let's get down to the chase! Introduces a good open source application framework on the Java platform Spring, as well as the basic knowledge of the spring framework's history and spring framework.

"Reproduced use, please specify the source: http://blog.csdn.net/mahoking "


Spring Introduction

Spring is an open-source application framework on the Java platform. The first version of it was written by Rod Johnson. Rod has released this framework for the first time in his book, "Expert one-on-one Java EE Design and development (one-to-one for Java Enterprise Application designers and developers)." Rod further expanded his code to illustrate "How to enable applications to work with the different components of the Java EE platform beyond the ease and stability that the masses are accustomed to accepting at the time."
The spring framework was first published in June 2003 with the Apache 2.0 license. The first landmark version was released in March 2004 in 1.0. In September 2004 and March 2005 there were also important editions.
The Spring framework itself does not impose any special programming patterns. In the Java community, Spring is popular as an alternative to the EJB model and even as a substitute. From a design point of view, Spring gives Java programmers a lot of freedom, but also provides good documentation and easy-to-use methods for common problems in the industry.
The core functionality of the Spring Framework is applicable in any Java application. In the Web application based on the Java Enterprise platform, a great deal of expansion and improvement can be formed. To this end, spring has been widely welcomed and recognized by many companies as a strategic and important framework.


Key features of the spring framework
    • Configuration management based on Java beans, using IOC principles, especially for the use of dependent injection technology. These are used to reduce the interdependence of the implementation rules among the components.
    • A core, globally applicable bean factory.
    • A general abstraction level to manage data processing between databases.
    • A general strategy built within the framework for the Java Data Processing API and a separate JDBC source. Therefore, the dependency on the Java Enterprise version environment is eliminated on data processing support.
    • and a number of sustainability frameworks, such as hibernate,jdo,ibatis and db4o integration.
    • The MVC framework in Web applications, based on the core spring features, supports a variety of techniques for generating views, including Jsp,freemarker,velocity,tiles,itext, and POI.
    • A large number of AOP frameworks to provide services such as data processing management. As with IOC, the aim is to improve the modularity of the system.


related concepts involved in spring framework
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.
Spring is a lightweight control inversion (IoC) and facet-oriented (AOP) container framework.
Light weightSpring is lightweight, both in terms of size and overhead. The full spring framework can be published in a jar file with a size of more than 1MB. and the processing overhead required by spring is negligible. In addition, spring is non-intrusive: Typically, objects in spring applications do not depend on a particular class of spring.
Control ReversalThe--spring facilitates loose coupling through a technique called inversion of Control (IoC). When an IOC is applied, other objects that an object relies on are passed in passively, rather than the object itself creating or locating dependent objects. You can think of the IOC as opposed to Jndi--not the object looking for dependencies from the container, but the container actively passing the dependency to it when the object is initialized without waiting for the object to be requested.
Face Tangent--spring provides rich support for aspect-oriented programming, allowing for the development of cohesion through the separation of application business logic with system-level services such as auditing (auditing) and transaction (transaction) management. The Application object only implements what they should do-complete the business logic-that's all. They are not responsible (or even conscious) for other system-level concerns, such as log or transaction support.
Container--spring contains and manages the configuration and lifecycle of the Application object, in this sense it is a container where you can configure how each of your beans is created-based on a configurable prototype (prototype), Your bean can create a separate instance or generate a new instance each time it is needed-and how they relate to each other. However, spring should not be confused with traditional heavyweight ejb containers, which are often bulky and cumbersome and difficult to use.
Frame--spring can be used to configure and assemble simple components into complex applications. In spring, application objects are combined declaratively, typically in an XML file. Spring also provides a number of basic functions (transaction management, persistence framework integration, etc.), leaving the development of application logic to the developer.
All of these features of spring enable you to write cleaner, more manageable, and easier-to-test code. They also provide basic support for the various modules in spring.


Seven modules of the Spring framework
The Spring framework is a layered architecture consisting of 7 well-defined modules. The Spring module is built on top of the core container, and the core container defines how the beans are created, configured, and managed.

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:
Spring Core (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 (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:The Spring AOP module integrates aspect-oriented programming functionality directly into the spring framework through configuration management features. 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.
Spring DAO:The JDBC DAO 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). Spring DAO's JDBC-oriented exception conforms to the common DAO exception hierarchy.
Spring ORM:The 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: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 Web MVC: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.


"Reproduced use, please specify the source: http://blog.csdn.net/mahoking "


Spring Learning "Spring Overview"

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.