Java Classic face Question---2----->spring framework of the relevant introduction

Source: Internet
Author: User

Spring is an open-source, lightweight framework whose core is inversion of control (IOC) and aspect-oriented programming (AOP).

As a business layer framework, spring is a good way to integrate the presentation layer with the persistence layer.

IOC: Writes the creation and dependency of a class to a configuration file, allowing the dependency of an object to be injected by a configuration file instead of being active to new, allowing for loose coupling.

Popular point is: the creation of the object of control to transfer, the creation of the object and the creation of the time is self-control, now put him to the IOC container, dedicated to create the object of the factory, changed the original dependency, now become dependent on the IOC container.

IOC creates an object in 3 ways: 1. Call the parameterless constructor 2. Constructor with parameters 3. Factory Class Create Object

AOP: The aspect-oriented programming that encapsulates some of the cross-cutting business logic (security, logs, things, etc.) in a program into a slice and then injects it into the target object (the specific business logic).

Separate processing can be done through the corresponding classes and XML configuration.

Pros: 1. Using the IOC container reduces coupling and allows you to focus more on business logic.

2. Low-intrusive design, code reuse is high, easy to maintain.

3. Integration with third-party frameworks works well.

Java Classic face Question---2----->spring framework of the relevant introduction

Related Article

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.