What is the function of spring in the actual use of the project?

Source: Internet
Author: User
Tags aop exception handling

Commonly used to aop!

Plane-oriented programming: Aspect Oriented Programming
AOP is the continuation of OOP, the abbreviation for (Aspect oriented programming), meaning aspect-oriented programming.
The main functions are: Logging, performance statistics, security control, transaction processing, exception handling and so on.
The main intent is to divide the code of logging, performance statistics, security control, transaction processing, exception handling, and so forth from the business logic code, and through the separation of these behaviors, we want to be able to separate them into the method of business logic, and then change these behaviors without affecting the code of business logic.
A technology that can dynamically and uniformly add functionality to a program without modifying source code is possible through precompilation and run-time dynamic proxies. AOP is actually a continuation of the GOF design pattern, and the design pattern pursues the decoupling between the caller and the callee, and AOP can be said to be an implementation of this goal.
Extensive support for aspect-oriented programming is provided in spring, 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.

For example: "Regardless of the message returned to the user, I would like to add a ' respectable user, '", at this time, we can intercept the return message of the Get method, in return to add the word "Dear user,".

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.