Introduction to the spring--framework

Source: Internet
Author: User
Tags aop to domain

I. Introduction to SPRING

Spring is an open source framework that is created to address the complexities of enterprise application development. One of the main advantages of the framework is its layered architecture, which allows you to choose which components to use while providing an integrated framework for Java EE application development. Spring is a lightweight control inversion (IoC) and aspect-oriented (AOP) container framework, is a layered one-stop open source development framework, it is mainly to solve the complexity of enterprise application development, the purpose: To solve the complexity of enterprise application development, function: Use basic JavaBean instead of EJB, scope: any Java application.

Ii. Origins of Spring

Spring exists because of its unique advantages:

2.1 The field it locates is that many other popular frameworks are not there

2.2 Spring is comprehensive and modular

2.3 It's designed from the bottom to help you write code that is easy to test

2.4 Spring is a potential one-stop solution

Three, the advantages of spring

Spring naturally has the following advantages:

3.1 Low-intrusive design with very low code contamination

3.2 Write Once, Run Anywhere

3.3 di effectively reduces the coupling degree

3.4 aop[face-cutting] provides centralized management of common tasks

3.5 orm and DAO simplifies access to the database

3.6 High degree of openness, not mandatory

The benefits of spring are beneficial to development:

3.1 can effectively organize middle-tier objects

3.2 Using a unified configuration file

3.3 Promote good programming habits and reduce programming costs

3.4 Easy Unit Testing

3.5 making EJBs an alternative

3.6 provides a consistent framework for data access

Iv. Features of Spring

4.1 Convenient decoupling for simplified development

Support for 4.2 AOP programming

4.3 Support for declarative transactions

4.4 Test of the convenience program

4.5 Convenient integration of a variety of excellent frameworks

4.6 Lower Java EE

4.7 API is difficult to use

4.8 Spring Source code is a classic learning paradigm

V. Basic framework of Spring

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 bean is created, configured, and managed, as shown in.

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 that it is the implementation of the factory pattern. BeanFactoryUse 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.
  • 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 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 model is composed of JavaBean, which is stored in map, the view is an interface, is responsible for displaying the model, and the controller represents the logic code. 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.

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. in short, spring brings a complex development of the Java EE, the core of which is the lightweight IOC container, and its goal is to provide a comprehensive framework for the Java EE application, a combination of multiple sub-frameworks in the spring framework, which can be independent of each other, Other frameworks can also be used instead, and Spring wants to provide a one-stop solution for enterprise applications

Introduction to the spring--framework

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.