1—Introduction to Spring AOP (Aspect-Oriented Programming)
Why AOP
AOP is used in applications that have cross-cutting
concerns, that is, pieces of logic or code that are written in multiple
classes/layers as per the requirements.
Common examples:
Transaction Management
• Logging
•Exception Handling
(especially when you may want to have detailed traces or have some plan of
recovering from exceptions)
• Security aspects • Instrumentation
Understanding Concerns
A concern is a piece of code that performs a specific task.
There are two types of concerns:
1) “Core” concerns
are codes used for business logic
2) “Cross concerns”
are functions that are conceptually separate from the application's business
logic but affect the entire service layer. Example: logging, auditing,
declarative transactions, security, caching
What Is AOP?
1) It is one of the basic components of Spring framework.
2) The main idea of AOP (Aspect-Oriented Programing) is to
isolate the cross-cutting concerns from the application code, thereby
modularizing them as a different entity.
3) Services layer
deals with two types of concerns: Core and cross cutting concerns.
Uses of AOP:-
0 Comments