What is spring and what are its benefits?
Spring is a container framework for lightweight control inversion (IOC) and aspect-oriented (AOP)
It is mainly for the solution of the complexity of enterprise application development is Born:
Objective: To solve the complexity of enterprise-level application development. Function: Use basic JavaBean instead of EJB.
Scope: any Java application.
Spring exists because of its own unique advantages:
It is positioned in areas that many other popular frameworks do not have.
Spring is comprehensive and modular.
It's designed to help you write code that is easy to test from the bottom.
Spring is a potential one-stop solution.
Spring is born with a bit of the following:
Low-invasive design, low code pollution.
Write Once,run Anywhere
Di effectively reduces the degree of coupling.
AOP provides centralized management of common tasks.
ORM and DAO simplify access to the database.
Highly open, not mandatory (runs through the transition layer, business layer, persistence layer)
The benefits of spring for development:
You can effectively organize middle-tier objects.
Use the same configuration file.
Promote good programming habits and reduce programming costs.
Easy to unit test. (A Spring basic group is JavaBean, and the second provides support for juit)
Make EJBs an alternative.
Provides a consistent framework for data access.
Spring Features:
Easy decoupling and simplified development.
AOP (facet-oriented programming) support.
Support for declarative Things
Easy to program test
Facilitate the integration of a variety of excellent frameworks.
Reduce the difficulty of Java EE API usage.
Spring's source code is a classic learning paradigm.
with the popular understanding of AOP :
A component A, which does not care about other common service component B, but when this component a uses B, it is not called by component A itself,
Instead, the columns, such as spring, can pass through an XML configuration file, such as through configuration. So that a does not need to know what service component B is like, there is no love, and how love exists has nothing to do with a. A just need to care about your own business.
Business logic, specific a use B, the configuration file to do, with the specific a component independent.
the popular understanding attached to the IOC is as follows :
IOC control reversal : It says that the control of creating an object instance is stripped from code control to the IOC container control, which is actually what you control in the XML file,
Focus on the principle. di Dependency Injection : It is said that when creating an object instance, a property value or other object instance is injected into the object, focusing on the implementation.
Summary:
Spring brings a complex dj2ee development.
Its core is the lightweight IOC container, its goal is to provide a full range of Integration Framework for Java EE applications, in the spring framework
To implement a combination of multiple child frameworks, which can be independent of each other, and can be replaced with other framework schemes.
Spring wants to provide a one-stop solution for enterprise applications (recommended: If it is a high concurrent large project, use it cautiously,
because the project uses a large number of reflection mechanisms, performance is bound to be affected. )