Programming AOP and adorners for facets??

Source: Internet
Author: User

1. AOP Concept: Aspect-oriented programming, refers to the extension function does not modify the source code, the function code is separated from the business logic code.

Main functions: Logging, performance statistics, security control, transaction processing, exception handling and so on.

The main intent: to divide the code of logging, performance statistics, security control, transaction processing, exception handling, and so forth from the business logic code, through the separation of these behaviors, we want to be able to separate them into non-guiding methods of business logic, and then change these behaviors without affecting the code of the business logic.

2. AOP Features: The repetitive code of traditional longitudinal inheritance system is replaced by the horizontal extraction mechanism.

The adorner is a well-known design pattern, which is often used in scenes where there is a demand for facets, with the classic insert log, performance test, transaction processing, and so on. Decorators are a great design for solving such problems, and with adorners, we can pull out a lot of the same code that is not relevant to the function itself and continue to reuse it. In summary, the function of an adorner is to add additional functionality to an already existing object.

Programming AOP and adorners for facets??

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.