Aspect Oriented Architecture
Aspect Oriented Architecture
Aspect Oriented Architecture
ARCHITECTURE
MOHAMMAD HOSSEIN SHOJAEINIA
PREFACE
• Nowadays, dominant programming paradigm is
Object-Oriented Architecture and Programming
• Very good and simple for software engineering and
analyses
• Useful in current software engineering methodologies
• OOA is a good idea, but has some limitations!
OBJECT-ORIENTED PROGRAMMING
• What is it?
• A programming paradigm that modularize code into
Objects
• Components
• Class
• Smallest module in OOA
• Method
• Manipulate attributes, do functionalities, …
OBJECT-ORIENTED PROGRAMMING
(CONT’D)
• Advantages
• Good modularization (if correctly!)
• Readability
• Reusability (if good modularization!)
• Maintainability
•…
OBJECT-ORIENTED PROGRAMMING
(CONT’D)
• Disadvantages
• No addressing for cross-cutting concerns
• Hard to maintain
• Processes and Functionalities cause a lot of code
• Code duplication
•…
CROSS-CUTTING CONCERNS
• What is a concern?
• The term concern, refers to a part of the system that divided on basis
of functionality
• Primary concerns
• Single and specific functionality of primary requirements
• Like: Business logic
• Cross-cutting or System-wide concerns
• Applicable and effective on entire system
• Like: authentication, security, logging, transactions, …
OBJECT-ORIENTED ARCHITECTURE
Fruit
Shape
Color
Size
• Aspect Weaver
• Composition mechanism that coordinates aspects with the
other modules of the system.
• Takes the aspects and core modules, then returns final
project
• Performed by a specialized compiler called Weaver
ASPECT-ORIENTED ARCHITECTURE IDEA
base/core
program
weave
aspec
t
final
system
AOA VS OOA
• Similarities
• Code modularization
• Code reusability
• Code maintainability
• Difference
• OOP creates classes based on real-world objects
• AOP creates aspects based on functionalities/processes
BEFORE
Crosscutting Concerns
AFTER
Transaction Security
NOTE!