Aop2007
-
Upload
tuhindas -
Category
Technology
-
view
610 -
download
2
description
Transcript of Aop2007
Guided By:Guided By:
Prof. Manoj ChaudaryProf. Manoj Chaudary
Presented By:-Presented By:-
Tuhin DasTuhin Das
VI SEM CSE
Smt.Bhagwati Chaturvedi College of Engineering, Nagpur
“EXPRESSION” - THE PAPER PRESENTATION
CONTENTS INTRODUCTION
ABOUT OOP
ASPECT
ASPECTS & CLASSES
KEY CONCEPTS
EXAMPLE OF ASPECTS CROSS-CUT COMPONENTS
THE ROLE OF ASPECTS IN SOFTWARE DESIGN
ASPECTJ
ASPECTJ EXAMPLE
CONCLUSION
REFERENCES
INTRODUCTION
A new programming technique called aspect-oriented programming (AOP):
makes it possible to clearly express those programs that OOP fail to support
enables the modularization of cross-cutting concerns by supporting a new unit of s/w modularity aspects that provide encapsulation for crosscutting concerns
ASPECT
An ASPECT is defined very much like a class and can have methods, field, advice initializers named pointcutsThe current working definition :
modular units that cross-cut the structure of other modular units
units that is defined in terms of partial information from other units
exist in both design and implementation
ASPECTS & CLASSES
Similarities with classes:
have type
can extend classes and other aspects
can be abstract or concrete
can have fields, methods, and types as members
Differences with classes:
can additionally include as members pointcuts (picks out join points), advice (code that executes at each join point )
do not have constructor or finalizer and they cannot be created with the new operator
privileged aspects can access private members of other types
KEY CONCEPTS
Cross-cutting: Crosscutting is how to characterize a concern than spans
multiple units of OO modularity.cross-cutting is respnsible for tangling in the code.
Pointcut:This is the term given to the point of execution in the application at which cross-cutting concern needs to be applied.
Join Points: Well defined points in code that can be identified.
EXAMPLE OF ASPECTS CROSS-CUT COMPONENTS
We wanted to implement a distributed digital library that stores documents in many forms and provides a wide range of operations on those documents
APPLICATION COMPONENTS ASPECTS
digital database, minimizing network traffic,
Library printers, synchronization constraints,
services failure handling
EXAMPLES OF HOW ASPECTS CROSS-CUT COMPONENTS
There are several aspects of concerns, including:
THE ROLE OF ASPECTS IN SOFTWARE DESIGN
AOP aims at providing better means of addressing the well-known problem of separation of concerns.
Three basic approaches to addressing the process of separation of concerns:
JOINT POINT MODEL
The advice-related component of an aspect-oriented language defines a join point model (JPM).
A JPM defines three things: JOIN POINTS
POINTCUTS
ADVICE
AspectJ
AspectJ is:
a general-purpose AO extension to Java
Java platform compatible
easy to learn and use
freely available under an Open Source license
AspectJ enables the modular implementation of a wide range of crosscutting concerns
AspectJ
When written as an aspect the structure of a crosscutting concern is explicit and easy to reason aboutAspects are modular
AspectJ enables: name-based crosscutting (tend to affect a small number of other classes)
property-based crosscutting (range from small to large scale)
The goals of the AspectJ project are to make AOP technology available to a wide range of programmers, to build and support an AspectJ user community
AspectJ EXAMPLE
An example is tracing aspect that prints messages before certain display operation
The overall effect of this aspect is to print a descriptive message whenever the traced methods are called
AspectJ EXAMPLEAspect SimpleTracing
{
pointcut traced() :
call (void Display.update () ) ||call (void Display.repaint (..) );
before() : traced ()
{ println(“Entering:” + thisJoinPoint); }
void println (String str)
{ <write to appropriate stream> }
}
Traced identifies calls to several key methods on Display
Before advice on this pointcut uses a helper method of the aspect to print a message
Advice uses the thisJoinPoint special variable to an object that describes the current join point
CONCLUSION
In the coming years Aspect Oriented Programming will replace all the programming like POP, OOP, etc. and it is being implemented in large scale in upcoming IT industries. Languages C/C++,.NETFramework languages (C# / VB.NET)Delpi, Java, etc have implemented AOP, within the language, or as an external library.
REFERENCES
web site:
http://aosd.net/
http://aspectj.org/
http://www.ccs.neu.edu/home/lieber/connection-to
-aop.html
ANY QUESTIONS ??