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

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Dernier (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

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.