AOP ideas and Aspect-Oriented Programming

Source: Internet
Author: User

AOP ideas and Aspect-Oriented Programming

AOP is actually an extension of the gof four-person group design model.CodeIncrease the Coupling DegreeProgramThe flexibility and reusability of AOP is actually an implementation of the goal pursued by the design model. The so-called separation focus is to separate a common demand function from irrelevant classes. At the same time, it can make many classes share an action. Once the behavior changes, there is no need to modify many classes, you only need to modify this behavior. AOP is a programming method that implements decentralized attention. It encapsulates "Focus" in "aspect.

The object-oriented Programming (OOP) method is improved based on the process-oriented programming method, while the Aspect-oriented programming (AOP) method is) an innovative software development method. Although AOP and OOP are literally similar, they are two design ideas oriented to different fields. Oop abstracts and encapsulates entities, attributes, and operations in the problem field and in the business processing process. The core concept of object-oriented is vertically structured, the objective is to achieve a clearer and more efficient logical unit division, while AOP extracts the aspect of the business processing process. For example, an operation is involved in each module, this operation can be seen as "cross-cutting" in the system. In many cases, these operations are not relevant to the business logic or are not a required part of the logical operation. However, it is difficult for Object-Oriented Methods to handle this situation. AOP separates these operations from the business logic so that programmers can focus on the processing of business logic when writing programs, and the use of AOP will automatically couple the cross-cutting concerns throughout each module. AOP is faced with a certain step or stage in the processing process. It isolates different stages and fields and has achieved the isolation effect of low coupling between various parts in the logic process, it is essentially different from Aspect-Oriented Programming in terms of goals. The core idea of AOP is to separate the business logic processing part of an application from the common service that provides support for it, that is, the so-called "cross-node concern, these "cross-cutting concerns" run through the needs of multiple vertical modules in the program.

to use the AOP mechanism for development, you must first understand the aspect and break down the requirements into general points of attention and cross-cutting concerns, that is, separation of core module-level attention points and system-level cross-cutting concerns; then they implement these concerns independently. Finally, they use tools to combine the business logic code and the Cross-concern code to form the final program. Aspect-Oriented Programming can reduce coding time and repetition.

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.