Aspect Oriented Programming: Ramya - R
Aspect Oriented Programming: Ramya - R
Presented By:
RAMYA . R
Programming paradigms
Procedural programming
Executing a set of commands in a given sequence
Fortran, C, Cobol
Functional programming
Evaluating a function defined in terms of other functions
Lisp
Logic programming
Proving a theorem by finding values for the free variables
Prolog
Object-oriented programming (OOP)
Organizing a set of objects, each with its own set of responsibilities
Java, C++ (to some extent)
Aspect-oriented programming (AOP)
Executing code whenever a program shows certain behaviors
AspectJ (a Java extension)
Introduction
Examples:
Tracing (determining what methods are called
when)
Session tracking, session expiration
XML Parsing
Logging
Database
Concern
Concern – is a particular goal, concept, or
area of interest. An engineering process
deals with many concerns.
It can range from high-level notion to
low level-notion.
It can be functional or nonfunctional
(systemic).
Types of concerns
Core Concerns:
Primary core functionality.
Central functionality of a module.
Crosscutting Concerns:
System wide concerns that span multiple modules.
Cuts across the typical division of responsibility.
Crosscutting Concerns
Crosscutting concerns – concerns that in
conventional implementations cannot be
implemented without scattering code.
Display
*
Figure FigureElement
Point Line
getX() 2
getP1
getY() setP1
setX(int) setP1(Point)
setY(int) setP2(Point) DisplayUpdating
Terminology
Join point
Point cut
Advice
Aspect
Join points
A join point is a well-defined point in the
program flow.
Example pointcut:
Three types:
Before advice
After advice
Around advice
Aspect
Crosscutting concerns are implemented
in aspects instead of fusing them into core
modules.
have type
can extend classes and other aspects
can be abstract or concrete
can have fields, methods, and types as
members
Aspect are different than classes
http://en.wikipedia.org/wiki/Aspect-oriented_programming
http://www.developer.com/lang/article.php/3308941/Aspect-
Oriented-Programming.htm
http://www.aopworld.com
THANK U