What is AOP?
What is AOP?
Aspect-Oriented Programming (AOP) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns. It does so by adding behavior to existing code (an advice) without modifying the code itself, instead separately specifying which code is modified via a "pointcut" specification, such as "log all function calls when the function's name begins with 'set'". This modularization allows behaviors that cut across many kinds of programs, such as logging, error handling, or security features, to be added to a program without cluttering the code core to the functionality.
AOP complements traditional object-oriented programming (OOP) by enabling you to apply common functionalities across various parts of an application in a modular way. The key unit of modularity in OOP is the class, whereas in AOP, the unit of modularity is the aspect. Aspects enable the modularization of concerns such as transaction management that cut across multiple types and objects, often referred to as "crosscutting" concerns[1][2][4][5][12][15].
In practical terms, AOP involves the following concepts:
middle
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào