Professional Documents
Culture Documents
Introduction - Aop Methodology - Aop Languages - Aspectj
Introduction - Aop Methodology - Aop Languages - Aspectj
• Introduction
• AOP Methodology
• AOP Languages
• AspectJ
1
Programming Methodologies
Concern
Abstraction
AO Programming
Object
Function OO Programming Abstraction
Abstractio
n
Procedural Programming
Assembly Programming
Programming Methodologies
m/c Programming Evaluation
2
Introduction
3
Cont..
5
Terminology
Concern
•AOP is based on the idea that computer systems are better
programmed by separately specifying the various concerns
of a system
•Separation of concerns is an important software
engineering principle guiding all stage of a sw development
methodology
•Concerns:
are properties or areas of interest
can range from high-level notion to low level-notion
can be functional or nonfunctional (systemic)
6
Terminology cont
• Core concerns
– Central functionality of a Business logic (single
module)
– Customer and Account management, Interbanking
transactions, ATM transactions
• Crosscut concerns
– System-level, peripheral requirements (multiple
modules)
– Persistence of all entities, Transaction integrity,
Authorization of access to various services, logging,
Security, Error checking, Policy enforcement
7
Typical Application
Business Logic
Concern
Accounting
ATM
Persistence Logging
Database
Logging
Implementation
Persistence modules
System
8
Implementation by Traditional
Languages
API
invocations
Accounting Module
ATM Module
Logging Module
Database Module
9
Implementation by AOP
Automatically Weaving
Invocations
Accounting Module
API
Invocation
ATM Module
Logging Aspect Logging Module
Database Module
11
AOP Development Stages
Security Integrating all
Business concerns
Logic
Logging
Identify
concerns
Persistence
12
AOP Languages
• AOP Language Specification
– Describes the language constructs and
syntax
– Specification for implementing the
individual concerns and rules for weaving
different concerns
13
AOP Languages cont
14
AspectJ
• Aspect-oriented extension to Java language
• Language Specification
• Language Implementation
– Concern by Java Language
– Weaving rules by extension Tools
• Crosscutting in AspectJ
– Implementation of the weaving rules by the compiler
– 2 Types:
• Dynamic Crosscutting
– Weaving of new Behavior into execution of program
• Static Crosscutting
– weaving of modifications into the static structure, to support the
Dynamic Crosscutting
15
AspectJ cont
• Crosscutting Elements
– Join Point
• Well-defined points in the execution of a program
– Pointcut
• A means of referring to collections of join points and certain values at
those join points
– Advice
• Method-like constructs to define additional behavior at join points
– Introduction
• Instruction that changes to the classes, interfaces of the system
– Compile time Declaration
• Instruction for adding compile time warnings and errors to the system
– Aspect
• Unit of modular crosscutting implementation
16
Conclusion
• Aspect-oriented programming (AOP) is a new
paradigm--a new way to think about programming
• AOP is somewhat similar to event handling, where
the “events” are defined outside the code itself
• AspectJ is not itself a complete programming
language, but an adjunct to Java
• AspectJ does not add new capabilities to what Java
can do, but adds new ways of modularizing the code
• AspectJ is free, open source software
• Like all new technologies, AOP may--or may not--
catch on in a big way
17
THANK YOU
18