aspect oriented programing - introduction
DESCRIPTION
Very basic introduction to Aspect Oriented Programming. This helps you to prepare for learning AOP.TRANSCRIPT
Aspect-Oriented Programing
Introduction
What is the problem with OOP?
Any custom software development necessarily needs to address cross-cutting concerns.
PoolingValidation Caching
SynchronisationProfiling
Transaction
LoggingLoadBalancing Reomoting
PersistanceSecurity
How to share these behaviors without "dirty" code?
What is the problem with OOP?
Business Logic Code
Logging
Monitoring
Validation
Transaction
What is the problem with OOP?
• The OOP provides a good level of abstraction and modularity
• Complex problems often arrive at the following cases– Too many abstractions– Difficulty in breaking code– Strong Coupling between components– Scattered code
• Principles of software development S.O.L.I.D– SRP
AOP
• aspect-oriented programming (AOP) is a programming paradigm that aims to increase modularity by allowing the separation of cross-cutting concerns
- wikipedia
A simplistic example
Identification of cross-cutting Concerns
A simplistic example
Writing the advice
A simplistic example
Select the action points (pointcut)
In our example: Pointcut = "At the beginning of each method"
In summary, AOP is
• Identify needs transverse (cross cutting concerns)
• Write one or more plugin code (advices)– Representation aspect – Encapsulation of behavior.
• Choosing where to apply these plugin(pointcuts)
OOP + AOP
Who links the code ?
Weaver
When to use AOP ?
Q & A ?