SlideShare une entreprise Scribd logo
1  sur  33
AspectJ ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],p.
a simple figure editor p.  operations that move elements Display * 2 Point -x: int -y: int +getX() +getY() +setX(int) +setY(int) Line -p1:Point -p2: Point +getP1() +getP2() +setP1(Point) +setP2(Point) factory methods Figure <<factory>> +makePoint(..) +makeLine(..) FigureElement +setXY(int, int) +draw()
a simple figure editor p.  class  Line implements FigureElement{ private  Point p1, p2; Point getP1() {  return  p1; } Point getP2() {  return  p2; } void  setP1(Point p1) {  this .p1 = p1; } void  setP2(Point p2) {  this .p2 = p2; } void  setXY( int  x,  int  y) {…} } class  Point implements FigureElement { private   int  x = 0, y = 0; int  getX() {  return  x; } int  getY() {  return  y; } void  setX( int  x) {  this .x = x; } void  setY( int  y) {  this .y = y; } void  setXY( int  x,  int  y){…} }
join points p.  a Line a Point returning or throwing dispatch dispatch key points in dynamic call graph returning or throwing returning or throwing imagine  l.setXY(2, 2) a method call a method execution a method execution
join point terminology ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],p.  a Line dispatch method call join points method execution join points
join point terminology: p.  all join points on this slide are within the control flow of this join point imagine  l.setXY(2, 2) a Point a Line a Point
primitive pointcuts ,[object Object],[object Object],[object Object],[object Object],p.  “ a means of identifying join points” matches if the join point is a method call with this signature
pointcut composition p.  whenever a Line receives a    “ void  setP1(Point)” or “ void  setP2(Point)” method call call( void  Line.setP1(Point)) ||  call( void  Line.setP2(Point)); pointcuts compose like predicates, using &&, || and ! or a “void Line.setP2(Point)” call a “void Line.setP1(Point)” call
Pointcuts ,[object Object],[object Object],[object Object],[object Object],[object Object],p.  This pointcut captures all the join points where a  FigureElement moves ,[object Object],[object Object]
named pointcuts ,[object Object],[object Object],p.  pointcut move():  call(void FigureElement.setXY(int,int)) ||  call(void Point.setX(int))  ||  call(void Point.setY(int))  ||  call(void Line.setP1(Point))  ||  call(void Line.setP2(Point )); name parameters more on parameters and how pointcut can expose values at join points in a few slides
Name-based and property-based pointcuts ,[object Object],[object Object],p.  call(void Figure.make*(..)) call(public * Figure.* (..)) cflow(move()) wildcard special primitive pointcut
Example primitive pointcuts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],p.
Example pointcuts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],p.
Advice ,[object Object],[object Object],[object Object],[object Object],[object Object],p.  before(): move() {  System.out.println(&quot;about to move&quot;); } after() returning: move() {  System.out.println(&quot;just successfully moved&quot;); }
Exposing context in pointcuts ,[object Object],[object Object],p.  after(FigureElement  fe , int  x , int  y ) returning:  ...SomePointcut... {  System.out.println(fe + &quot; moved to (&quot; + x + &quot;, &quot; + y + &quot;)&quot;);} after(FigureElement fe, int x, int y) returning:  call(void FigureElement.setXY(int, int))  &&  target (fe)  &&  args (x, y) {  System.out.println(fe + &quot; moved to (&quot; + x + &quot;, &quot; + y + &quot;)&quot;);} Advice declares and use parameter list Pointcuts publish values
Exposing context in named pointcuts ,[object Object],[object Object],p.  pointcut setXY(FigureElement fe, int x, int y):  call(void FigureElement.setXY(int, int))  && target(fe)  && args(x, y); after(FigureElement fe, int x, int y) returning:  setXY(fe, x, y) {  System.out.println(fe + &quot; moved to (&quot; + x + &quot;, &quot; + y +  &quot;).&quot;);} pointcut parameter list Pointcuts publish context
explaining parameters… ,[object Object],[object Object],[object Object],[object Object],p.  pointcut  move(Line l):    target(l) && (call( void  Line.setP1(Point)) ||  call( void  Line.setP2(Point))); after (Line line): move(line) {   <line is bound to the line> }
Aspects ,[object Object],[object Object],[object Object],[object Object],p.  aspect Logging {  OutputStream logStream = System.err;  before(): move() {  logStream.println(&quot;about to move&quot;);  } }
Inter-type declarations ,[object Object],p.  aspect PointObserving {  private Vector Point.observers = new Vector();   public static void addObserver(Point p, Screen s) {  p.observers.add(s);  }  public static void removeObserver(Point p, Screen s) {  p.observers.remove(s);  }  pointcut changes(Point p):  target(p) && call(void Point.set*(int));  after(Point p): changes(p) {  Iterator iter = p.observers.iterator();  while ( iter.hasNext() ) {  updateObserver(p, (Screen)iter.next());  }}  static void updateObserver(Point p, Screen s) {  s.display(p);  }}
Examples ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],p.
Tracing ,[object Object],[object Object],p.  aspect SimpleTracing {  pointcut tracedCall():  call(void FigureElement.draw(GraphicsContext));  before(): tracedCall() {  System.out.println(&quot;Entering: &quot; +  thisJoinPoint );  } }
Profiling and Logging ,[object Object],[object Object],p.  aspect SetsInRotateCounting {  int rotateCount = 0;  int setCount = 0;  before(): call(void Line.rotate(double)) {  rotateCount++;  }  before(): call(void Point.set*(int))  && cflow(call(void Line.rotate(double))) {  setCount++; } }
Pre- and post- conditions ,[object Object],p.  aspect PointBoundsChecking {  pointcut setX(int x):  (call(void FigureElement.setXY(int, int)) && args(x, *))  || (call(void Point.setX(int)) && args(x));  pointcut setY(int y):  (call(void FigureElement.setXY(int, int)) && args(*, y))  || (call(void Point.setY(int)) && args(y));  before(int x): setX(x) {  if ( x < MIN_X || x > MAX_X )  throw new IllegalArgumentException(&quot;x is out of bounds.&quot;);  }  before(int y): setY(y) {  if ( y < MIN_Y || y > MAX_Y )  throw new IllegalArgumentException(&quot;y is out of   bounds.&quot;);  }}
Contract enforcement ,[object Object],[object Object],p.  aspect RegistrationProtection {  pointcut register():  call(void Registry.register(FigureElement));  pointcut canRegister():  withincode(static * FigureElement.make*(..));  before(): register() && !canRegister() {  throw new IllegalAccessException(&quot;Illegal call &quot; + thisJoinPoint); } }
Contract enforcement ,[object Object],p.  aspect RegistrationProtection {  pointcut register():  call(void Registry.register(FigureElement));  pointcut canRegister():  withincode(static * FigureElement.make*(..));  declare error : register() && !canRegister(): &quot;Illegal call&quot;} }
Change monitoring ,[object Object],[object Object],p.  aspect MoveTracking {  private static boolean dirty = false;  public static boolean testAndClear() {  boolean result = dirty;  dirty = false;  return result;  }  pointcut move():  call(void FigureElement.setXY(int, int)) ||  call(void Line.setP1(Point))  ||  call(void Line.setP2(Point))  ||  call(void Point.setX(int))  ||  call(void Point.setY(int));  after() returning: move() {  dirty = true; } }
Context passing ,[object Object],[object Object],p.  aspect ColorControl {  pointcut CCClientCflow(ColorControllingClient client):  cflow(call(* * (..)) && target(client));  pointcut make(): call(FigureElement Figure.make*(..));  after (ColorControllingClient c) returning  (FigureElement fe):  make() && CCClientCflow(c) {  fe.setColor(c.colorFor(fe)); } }
Providing consistent behavior ,[object Object],[object Object],p.  aspect PublicErrorLogging {  Log log = new Log();  pointcut publicMethodCall():  call(public * com.bigboxco.*.*(..));  after() throwing (Error e): publicMethodCall() {  log.write(e); } } after() throwing (Error e):  publicMethodCall() && !cflow(publicMethodCall()) {  log.write(e); }
wildcarding in pointcuts p.  target(Point) target(graphics.geom.Point) target(graphics.geom.*) any type in graphics.geom target(graphics..*) any type in any sub-package of graphics call( void  Point.setX( int )) call( public  * Point.*(..)) any public method on Point call( public  * *(..)) any public method on any type call( void  Point.getX()) call( void  Point.getY()) call( void  Point.get*()) call( void  get*())  any getter call(Point. new ( int, int )) call( new (..)) any constructor “ *” is wild card “ ..” is multi-part wild card
other primitive pointcuts p.  this(<type name>) within(<type name>) withincode(<method/constructor signature>) any join point at which currently executing object is an instance of type name currently executing code is contained within type name   currently executing code is specified method or constructor get( int  Point.x) set( int  Point.x) field reference or assignment join points
other primitive pointcuts p.  execution(void Point.setX(int)) method/constructor execution join points (actual running method) initialization(Point) object initialization join points staticinitialization(Point) class initialization join points (as the class is loaded) cflow( pointcut designator ) all join points within the dynamic control flow of any join point in  pointcut designator   cflowbelow( pointcut designator ) all join points within the dynamic control flow below any join point in  pointcut designator
Inheritance ,[object Object],[object Object],[object Object],[object Object],p.
Aspect Reuse ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],p.

Contenu connexe

Tendances

Programming Fundamentals Decisions
Programming Fundamentals  Decisions Programming Fundamentals  Decisions
Programming Fundamentals Decisions imtiazalijoono
 
OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1vikram mahendra
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]vikram mahendra
 
Lecture#8 introduction to array with examples c++
Lecture#8 introduction to array with examples c++Lecture#8 introduction to array with examples c++
Lecture#8 introduction to array with examples c++NUST Stuff
 
C aptitude scribd
C aptitude scribdC aptitude scribd
C aptitude scribdAmit Kapoor
 
An imperative study of c
An imperative study of cAn imperative study of c
An imperative study of cTushar B Kute
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONvikram mahendra
 
Lecture#9 Arrays in c++
Lecture#9 Arrays in c++Lecture#9 Arrays in c++
Lecture#9 Arrays in c++NUST Stuff
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1AmIt Prasad
 
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]vikram mahendra
 
Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)Dharma Kshetri
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 FocJAYA
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3Abdul Haseeb
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTsKevlin Henney
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALVivek Kumar Sinha
 

Tendances (20)

Programming Fundamentals Decisions
Programming Fundamentals  Decisions Programming Fundamentals  Decisions
Programming Fundamentals Decisions
 
OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1OPERATOR IN PYTHON-PART1
OPERATOR IN PYTHON-PART1
 
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
USER DEFINE FUNCTIONS IN PYTHON[WITH PARAMETERS]
 
Lecture#8 introduction to array with examples c++
Lecture#8 introduction to array with examples c++Lecture#8 introduction to array with examples c++
Lecture#8 introduction to array with examples c++
 
C aptitude scribd
C aptitude scribdC aptitude scribd
C aptitude scribd
 
An imperative study of c
An imperative study of cAn imperative study of c
An imperative study of c
 
INTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHONINTRODUCTION TO FUNCTIONS IN PYTHON
INTRODUCTION TO FUNCTIONS IN PYTHON
 
Advanced C - Part 2
Advanced C - Part 2Advanced C - Part 2
Advanced C - Part 2
 
C programs
C programsC programs
C programs
 
Lecture#9 Arrays in c++
Lecture#9 Arrays in c++Lecture#9 Arrays in c++
Lecture#9 Arrays in c++
 
46630497 fun-pointer-1
46630497 fun-pointer-146630497 fun-pointer-1
46630497 fun-pointer-1
 
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]FUNCTIONS IN PYTHON[RANDOM FUNCTION]
FUNCTIONS IN PYTHON[RANDOM FUNCTION]
 
Pointers
PointersPointers
Pointers
 
Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)Maharishi University of Management (MSc Computer Science test questions)
Maharishi University of Management (MSc Computer Science test questions)
 
C++ Pointers
C++ PointersC++ Pointers
C++ Pointers
 
Unit 5 Foc
Unit 5 FocUnit 5 Foc
Unit 5 Foc
 
functions
functionsfunctions
functions
 
Python programming workshop session 3
Python programming workshop session 3Python programming workshop session 3
Python programming workshop session 3
 
Programming with GUTs
Programming with GUTsProgramming with GUTs
Programming with GUTs
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
 

Similaire à Introduction to AspectJ

Aspect-Oriented Technologies
Aspect-Oriented TechnologiesAspect-Oriented Technologies
Aspect-Oriented TechnologiesEsteban Abait
 
45 aop-programming
45 aop-programming45 aop-programming
45 aop-programmingdaotuan85
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorJussi Pohjolainen
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]Abhishek Sinha
 
Boost.Interfaces
Boost.InterfacesBoost.Interfaces
Boost.Interfacesmelpon
 
L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxhappycocoman
 
Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04hassaanciit
 
Function recap
Function recapFunction recap
Function recapalish sha
 
Function recap
Function recapFunction recap
Function recapalish sha
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Ismar Silveira
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Juan Pablo
 
Ch6 pointers (latest)
Ch6 pointers (latest)Ch6 pointers (latest)
Ch6 pointers (latest)Hattori Sidek
 

Similaire à Introduction to AspectJ (20)

Aspect-Oriented Technologies
Aspect-Oriented TechnologiesAspect-Oriented Technologies
Aspect-Oriented Technologies
 
45 aop-programming
45 aop-programming45 aop-programming
45 aop-programming
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 
Concepts of C [Module 2]
Concepts of C [Module 2]Concepts of C [Module 2]
Concepts of C [Module 2]
 
Boost.Interfaces
Boost.InterfacesBoost.Interfaces
Boost.Interfaces
 
Pointers [compatibility mode]
Pointers [compatibility mode]Pointers [compatibility mode]
Pointers [compatibility mode]
 
L25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptxL25-L26-Parameter passing techniques.pptx
L25-L26-Parameter passing techniques.pptx
 
C programming
C programmingC programming
C programming
 
Array Cont
Array ContArray Cont
Array Cont
 
Managing console
Managing consoleManaging console
Managing console
 
CSE240 Pointers
CSE240 PointersCSE240 Pointers
CSE240 Pointers
 
Pointers+(2)
Pointers+(2)Pointers+(2)
Pointers+(2)
 
Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04Introduction to Computer and Programing - Lecture 04
Introduction to Computer and Programing - Lecture 04
 
C++ L11-Polymorphism
C++ L11-PolymorphismC++ L11-Polymorphism
C++ L11-Polymorphism
 
Function recap
Function recapFunction recap
Function recap
 
Function recap
Function recapFunction recap
Function recap
 
Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4Paradigmas de Linguagens de Programacao - Aula #4
Paradigmas de Linguagens de Programacao - Aula #4
 
Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#Lo Mejor Del Pdc2008 El Futrode C#
Lo Mejor Del Pdc2008 El Futrode C#
 
Qprgs
QprgsQprgs
Qprgs
 
Ch6 pointers (latest)
Ch6 pointers (latest)Ch6 pointers (latest)
Ch6 pointers (latest)
 

Dernier

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Dernier (20)

🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

Introduction to AspectJ

  • 1.
  • 2. a simple figure editor p. operations that move elements Display * 2 Point -x: int -y: int +getX() +getY() +setX(int) +setY(int) Line -p1:Point -p2: Point +getP1() +getP2() +setP1(Point) +setP2(Point) factory methods Figure <<factory>> +makePoint(..) +makeLine(..) FigureElement +setXY(int, int) +draw()
  • 3. a simple figure editor p. class Line implements FigureElement{ private Point p1, p2; Point getP1() { return p1; } Point getP2() { return p2; } void setP1(Point p1) { this .p1 = p1; } void setP2(Point p2) { this .p2 = p2; } void setXY( int x, int y) {…} } class Point implements FigureElement { private int x = 0, y = 0; int getX() { return x; } int getY() { return y; } void setX( int x) { this .x = x; } void setY( int y) { this .y = y; } void setXY( int x, int y){…} }
  • 4. join points p. a Line a Point returning or throwing dispatch dispatch key points in dynamic call graph returning or throwing returning or throwing imagine l.setXY(2, 2) a method call a method execution a method execution
  • 5.
  • 6. join point terminology: p. all join points on this slide are within the control flow of this join point imagine l.setXY(2, 2) a Point a Line a Point
  • 7.
  • 8. pointcut composition p. whenever a Line receives a “ void setP1(Point)” or “ void setP2(Point)” method call call( void Line.setP1(Point)) || call( void Line.setP2(Point)); pointcuts compose like predicates, using &&, || and ! or a “void Line.setP2(Point)” call a “void Line.setP1(Point)” call
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29. wildcarding in pointcuts p. target(Point) target(graphics.geom.Point) target(graphics.geom.*) any type in graphics.geom target(graphics..*) any type in any sub-package of graphics call( void Point.setX( int )) call( public * Point.*(..)) any public method on Point call( public * *(..)) any public method on any type call( void Point.getX()) call( void Point.getY()) call( void Point.get*()) call( void get*()) any getter call(Point. new ( int, int )) call( new (..)) any constructor “ *” is wild card “ ..” is multi-part wild card
  • 30. other primitive pointcuts p. this(<type name>) within(<type name>) withincode(<method/constructor signature>) any join point at which currently executing object is an instance of type name currently executing code is contained within type name currently executing code is specified method or constructor get( int Point.x) set( int Point.x) field reference or assignment join points
  • 31. other primitive pointcuts p. execution(void Point.setX(int)) method/constructor execution join points (actual running method) initialization(Point) object initialization join points staticinitialization(Point) class initialization join points (as the class is loaded) cflow( pointcut designator ) all join points within the dynamic control flow of any join point in pointcut designator cflowbelow( pointcut designator ) all join points within the dynamic control flow below any join point in pointcut designator
  • 32.
  • 33.