Published on

Aspect Oriented programming.. A new era...

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. Guided By: Prof. Manoj Chaudary Presented By:- Tuhin Das VI SEM CSE Smt.Bhagwati Chaturvedi College of Engineering, Nagpur “ EXPRESSION” - THE PAPER PRESENTATION
  2. 2. CONTENTS <ul><li>INTRODUCTION </li></ul><ul><li>ABOUT OOP </li></ul><ul><li>ASPECT </li></ul><ul><li>ASPECTS & CLASSES </li></ul><ul><li>KEY CONCEPTS </li></ul><ul><li>EXAMPLE OF ASPECTS CROSS-CUT COMPONENTS </li></ul><ul><li>THE ROLE OF ASPECTS IN SOFTWARE DESIGN </li></ul><ul><li>ASPECTJ </li></ul><ul><li>ASPECTJ EXAMPLE </li></ul><ul><li>CONCLUSION </li></ul><ul><li>REFERENCES </li></ul>
  3. 3. INTRODUCTION <ul><li>A new programming technique called aspect-oriented programming (AOP): </li></ul><ul><li>makes it possible to clearly express those programs that OOP fail to support </li></ul><ul><li>enables the modularization of cross-cutting concerns by supporting a new unit of s/w modularity aspects that provide encapsulation for crosscutting concerns </li></ul>
  4. 4. ASPECT <ul><li>An ASPECT is defined very much like a class and can have methods, field, advice initializers named pointcuts </li></ul><ul><li>The current working definition : </li></ul><ul><li>modular units that cross-cut the structure of other modular units </li></ul><ul><li>units that is defined in terms of partial information from other units </li></ul><ul><li>exist in both design and implementation </li></ul>
  5. 5. ASPECTS & CLASSES <ul><li>Similarities with classes: </li></ul><ul><li>have type </li></ul><ul><li>can extend classes and other aspects </li></ul><ul><li>can be abstract or concrete </li></ul><ul><li>can have fields, methods, and types as members </li></ul><ul><li> </li></ul><ul><li>Differences with classes: </li></ul><ul><li>can additionally include as members pointcuts (picks out join points), advice (code that executes at each join point ) </li></ul><ul><li>do not have constructor or finalizer and they cannot be created with the new operator </li></ul><ul><li>privileged aspects can access private members of other types </li></ul>
  6. 6. KEY CONCEPTS <ul><li>Cross-cutting: </li></ul><ul><ul><li> Crosscutting is how to characterize a concern than spans multiple units of OO modularity. </li></ul></ul><ul><ul><li>cross-cutting is respnsible for tangling in the code. </li></ul></ul><ul><ul><li>Pointcut: </li></ul></ul><ul><li>This is the term given to the point of execution in the application at which cross-cutting concern needs to be applied. </li></ul><ul><li> Join Points: </li></ul><ul><li> Well defined points in code that can be identified. </li></ul>
  7. 7. EXAMPLE OF ASPECTS CROSS-CUT COMPONENTS <ul><li>We wanted to implement a distributed digital library that stores documents in many forms and provides a wide range of operations on those documents </li></ul>APPLICATION COMPONENTS ASPECTS digital database, minimizing network traffic, Library printers, synchronization constraints, services failure handling
  8. 8. EXAMPLES OF HOW ASPECTS CROSS-CUT COMPONENTS There are several aspects of concerns, including:
  9. 9. THE ROLE OF ASPECTS IN SOFTWARE DESIGN <ul><li>AOP aims at providing better means of addressing the well-known problem of separation of concerns. </li></ul><ul><li>Three basic approaches to addressing the process of separation of concerns: </li></ul>
  10. 10. JOINT POINT MODEL The advice-related component of an aspect-oriented language defines a join point model (JPM). <ul><li>A JPM defines three things: </li></ul><ul><li>JOIN POINTS </li></ul><ul><li>POINTCUTS </li></ul><ul><li>ADVICE </li></ul>
  11. 11. AspectJ <ul><li>AspectJ is: </li></ul><ul><ul><li>a general-purpose AO extension to Java </li></ul></ul><ul><ul><li>Java platform compatible </li></ul></ul><ul><ul><li>easy to learn and use </li></ul></ul><ul><ul><li>freely available under an Open Source license </li></ul></ul><ul><li>AspectJ enables the modular implementation of a wide range of crosscutting concerns </li></ul>
  12. 12. AspectJ <ul><li>When written as an aspect the structure of a crosscutting concern is explicit and easy to reason about </li></ul><ul><li>Aspects are modular </li></ul><ul><ul><li>AspectJ enables: name-based crosscutting (tend to affect a small number of other classes) </li></ul></ul><ul><ul><li>property-based crosscutting (range from small to large scale) </li></ul></ul><ul><li>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 </li></ul>
  13. 13. AspectJ EXAMPLE <ul><li>An example is tracing aspect that prints messages before certain display operation </li></ul><ul><li>The overall effect of this aspect is to print a descriptive message whenever the traced methods are called </li></ul>
  14. 14. AspectJ EXAMPLE <ul><li>Aspect SimpleTracing </li></ul><ul><li>{ </li></ul><ul><li>pointcut traced() : </li></ul><ul><li>call (void Display.update () ) ||call (void Display.repaint (..) ); </li></ul><ul><li>before() : traced () </li></ul><ul><li>{ println(“Entering:” + thisJoinPoint); } </li></ul><ul><li>void println (String str) </li></ul><ul><li>{ <write to appropriate stream> } </li></ul><ul><li>} </li></ul>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
  15. 15. 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.
  16. 16. REFERENCES <ul><li>web site: </li></ul><ul><li> </li></ul><ul><li> </li></ul><ul><li> </li></ul>
  17. 17. ANY QUESTIONS ??