SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
PHANtom:
A Modern Aspect Language for Pharo
Johan Fabry, Daniel Galdames. PLEIAD Lab, DCC - Universidad de Chile
AOP ??




  Johan Fabry   2
AOP ??

 Cross-cutting concerns
 Aspect = module
  ‣ Behavior = WHAT = advice
  ‣ Quantification = WHEN = pointcuts
 Running application = stream of join points
  ‣ ST computation = messages
  ‣ In PHANtom: method exec

   Johan Fabry                                 2
AOP ??

 Cross-cutting concerns
 Aspect = module
  ‣ Behavior = WHAT = advice
  ‣ Quantification = WHEN = pointcuts
 Running application = stream of join points
  ‣ ST computation = messages
  ‣ In PHANtom: method exec

   Johan Fabry                                 2
AOP ??

 Cross-cutting concerns
 Aspect = module
  ‣ Behavior = WHAT = advice
  ‣ Quantification = WHEN = pointcuts
 Running application = stream of join points
  ‣ ST computation = messages
  ‣ In PHANtom: method exec

   Johan Fabry                                 2
AOP ??

 Cross-cutting concerns
 Aspect = module
  ‣ Behavior = WHAT = advice
  ‣ Quantification = WHEN = pointcuts
 Running application = stream of join points
  ‣ ST computation = messages
  ‣ In PHANtom: method exec

   Johan Fabry                                 2
AOP ??

 Cross-cutting concerns
 Aspect = module
  ‣ Behavior = WHAT = advice
  ‣ Quantification = WHEN = pointcuts
 Running application = stream of join points
  ‣ ST computation = messages
  ‣ In PHANtom: method exec

   Johan Fabry                                 2
In the spirit of Smalltalk

                 Dynamic




       Simple              Powerful


   Johan Fabry                        3
In the spirit of Smalltalk

                        Dynamic
                 Dynamic AOP




       Simple                     Powerful


   Johan Fabry                               3
In the spirit of Smalltalk

                        Dynamic
                 Dynamic AOP   Develop normally




       Simple                           Powerful


   Johan Fabry                                     3
In the spirit of Smalltalk

                        Dynamic
                 Dynamic AOP   Develop normally




       Simple                           Powerful
       Minimal set of Constructs


   Johan Fabry                                     3
In the spirit of Smalltalk

                        Dynamic
                 Dynamic AOP   Develop normally




       Simple                           Powerful
       Minimal set of Constructs
       Uniform / no restrictions

   Johan Fabry                                     3
In the spirit of Smalltalk

                        Dynamic
                 Dynamic AOP   Develop normally




       Simple                           Powerful
       Minimal set of Constructs        First-class everything
       Uniform / no restrictions

   Johan Fabry                                                   3
In the spirit of Smalltalk

                        Dynamic
                 Dynamic AOP   Develop normally




       Simple                           Powerful
       Minimal set of Constructs        First-class everything
       Uniform / no restrictions        New language features

   Johan Fabry                                              3
Pointcuts




                       Dyn



                 Sim         Pow
   Johan Fabry                4
Pointcuts

  PhPointcut receivers: 'TestCase'
      selectors: 'assert:'




                                           Dyn



                                     Sim         Pow
   Johan Fabry                                    4
Pointcuts

  PhPointcut receivers: 'TestCase'
      selectors: 'assert:'

  PhPointcut receivers: 'TestCase+'
      selectors: #(assert: assert:equals:)




                                            Dyn



                                      Sim         Pow
   Johan Fabry                                     4
Pointcuts

  PhPointcut receivers: 'TestCase'
      selectors: 'assert:'

  PhPointcut receivers: 'TestCase+'
      selectors: #(assert: assert:equals:)
      context: #(receiver sender arguments)




                                            Dyn



                                      Sim         Pow
   Johan Fabry                                     4
Pointcuts

  PhPointcut receivers: 'TestCase'
      selectors: 'assert:'

  PhPointcut receivers: 'TestCase+'
      selectors: #(assert: assert:equals:)
      context: #(receiver sender arguments)

  PhPointcut receivers: 'Test*'
      selectors: #(assert: assert:_:
                    assert:_:_:)
                                             Dyn
      context: #(receiver)
      restrict: #(Tests_Mine)
                                       Sim         Pow
   Johan Fabry                                      4
Advice




                      Dyn



                Sim         Pow
  Johan Fabry                5
Advice
 PhAdvice pointcut: pc
     send: #incCount: to: self
     type: #after




                                       Dyn



                                 Sim         Pow
  Johan Fabry                                 5
Advice
 PhAdvice pointcut: pc
     send: #incCount: to: self
     type: #after




 PhAdvice pointcut: pc
     advice: [:ctx |
         Transcript show:
             (ctx receiver asString);cr.
         ctx proceed.]]                Dyn
     type: #around.
                                     Sim     Pow
  Johan Fabry                                 5
Inter-Type Declaration




                               Dyn



                         Sim         Pow
   Johan Fabry                        6
Inter-Type Declaration

  PhClassModifier on: ACTestCase
      addIV: 'phacount'




                                         Dyn



                                   Sim         Pow
   Johan Fabry                                  6
Inter-Type Declaration

  PhClassModifier on: ACTestCase
      addIV: 'phacount'




  PhClassModifier on: ACTestCase
      addIM: 'phacount
          ↑phacount ifNil: [phacount := 0]'
                                            Dyn



                                      Sim         Pow
   Johan Fabry                                     6
Aspect

 PHAspect subclass: MyAspect ...
 (Object subclass: #PhAspect ...)



 Add PHAdvice and PHClassModifier instances



 Send install to activate

 Send uninstall to deactivate                       Dyn



                                              Sim         Pow
   Johan Fabry                                             7
What happens here?

 |asp|
 asp := PhAspect new add:
  (PhAdvice
     pointcut: (PhPointcut
         receivers: 'Transcript class'
         selectors: 'show:')
     advice: [ Transcript show: 'Have ']
     type: #before).
 asp install.
 Transcript show: 'reentrancy control'; cr



   Johan Fabry                               8
What happens here?

 |asp|
 asp := PhAspect new add:
  (PhAdvice
     pointcut: (PhPointcut
         receivers: 'Transcript class'
         selectors: 'show:')
     advice: [ Transcript show: 'Have ']
     type: #before).
 asp install.
 Transcript show: 'reentrancy control'; cr



   Johan Fabry                               8
What happens here?

 |asp|
 asp := PhAspect new add:
  (PhAdvice
     pointcut: (PhPointcut
         receivers: 'Transcript class'
         selectors: 'show:')
     advice: [ Transcript show: 'Have ']
     type: #before).
 asp install.
 Transcript show: 'reentrancy control'; cr



   Johan Fabry                               8
What happens here?

 |asp|
 asp := PhAspect new add:
  (PhAdvice
     pointcut: (PhPointcut
         receivers: 'Transcript class'
         selectors: 'show:')
     advice: [ Transcript show: 'Have ']
     type: #before).
 asp install.
 Transcript show: 'reentrancy control'; cr



   Johan Fabry                               8
What happens here?

 |asp|
 asp := PhAspect new add:
  (PhAdvice
     pointcut: (PhPointcut
         receivers: 'Transcript class'
         selectors: 'show:')
     advice: [ Transcript show: 'Have ']
     type: #before).
 asp install.
 Transcript show: 'reentrancy control'; cr



   Johan Fabry                               8
What happens here?

 |asp|
 asp := PhAspect new add:
  (PhAdvice
     pointcut: (PhPointcut
         receivers: 'Transcript class'
         selectors: 'show:')
     advice: [ Transcript show: 'Have ']
     type: #before).
 asp install.
 Transcript show: 'reentrancy control'; cr



   Johan Fabry                               8
What happens here?

 |asp|
 asp := PhAspect new add:
  (PhAdvice
     pointcut: (PhPointcut
         receivers: 'Transcript class'
         selectors: 'show:')
     advice: [ Transcript show: 'Have ']
     type: #before).
 asp install.
 Transcript show: 'reentrancy control'; cr



   Johan Fabry                               8
What happens here?

 |asp|




                 OM
 asp := PhAspect new add:
  (PhAdvice
     pointcut: (PhPointcut
         receivers: 'Transcript class'
         selectors: 'show:')
     advice: [ Transcript show: 'Have ']
     type: #before).
BO
 asp install.
 Transcript show: 'reentrancy control'; cr



   Johan Fabry                               8
Reentrancy control

 PHANtom: no problem!
  ‣ Aspect execution by default NOT MATCHED



 More power if you want it: Membranes [Tanter & Tabareau]



 Use membranes to control
  ‣ join point emission and capture scope
  ‣ aspect observing join points                         Dyn



                                                   Sim         Pow
   Johan Fabry                                                  9
Advice ordering
 Multiple advice 1 join point

 “Classic”: advice precedence
  ‣ Global and static

 PHANtom deployment precedence
  ‣ Global and ‘static’
  ‣ Complement or override on pointcut

 PHANtom dynamic precedence in the advice
  ‣ OrderedCollection of PHAdvice instances
  ‣ get from context                                Dyn
  ‣ set on context
                                              Sim         Pow
    Johan Fabry                                           10
Not in the paper ...

 TDD
  ‣ 155 tests
  ‣ 90+% coverage




   Johan Fabry         11
Not in the paper ...

 TDD
  ‣ 155 tests
  ‣ 90+% coverage




   Johan Fabry         11
Future work


 Optimize the implementation



 Compile PHANtom code



 Infrastructure for Domain-Specific Aspect Languages




   Johan Fabry                                        12
http://pleiad.cl/PHANtom




Johan Fabry                    13

Más contenido relacionado

Más de ESUG

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingESUG
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in PharoESUG
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapESUG
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoESUG
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...ESUG
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsESUG
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6ESUG
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationESUG
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingESUG
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesESUG
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportESUG
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsESUG
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector TuningESUG
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseESUG
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FutureESUG
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the DebuggerESUG
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing ScoreESUG
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptESUG
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocESUG
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsESUG
 

Más de ESUG (20)

Workshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programmingWorkshop: Identifying concept inventories in agile programming
Workshop: Identifying concept inventories in agile programming
 
Technical documentation support in Pharo
Technical documentation support in PharoTechnical documentation support in Pharo
Technical documentation support in Pharo
 
The Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and RoadmapThe Pharo Debugger and Debugging tools: Advances and Roadmap
The Pharo Debugger and Debugging tools: Advances and Roadmap
 
Sequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in PharoSequence: Pipeline modelling in Pharo
Sequence: Pipeline modelling in Pharo
 
Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...Migration process from monolithic to micro frontend architecture in mobile ap...
Migration process from monolithic to micro frontend architecture in mobile ap...
 
Analyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early resultsAnalyzing Dart Language with Pharo: Report and early results
Analyzing Dart Language with Pharo: Report and early results
 
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
Transpiling Pharo Classes to JS ECMAScript 5 versus ECMAScript 6
 
A Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test GenerationA Unit Test Metamodel for Test Generation
A Unit Test Metamodel for Test Generation
 
Creating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic ProgrammingCreating Unit Tests Using Genetic Programming
Creating Unit Tests Using Genetic Programming
 
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution ModesThreaded-Execution and CPS Provide Smooth Switching Between Execution Modes
Threaded-Execution and CPS Provide Smooth Switching Between Execution Modes
 
Exploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience ReportExploring GitHub Actions through EGAD: An Experience Report
Exploring GitHub Actions through EGAD: An Experience Report
 
Pharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIsPharo: a reflective language A first systematic analysis of reflective APIs
Pharo: a reflective language A first systematic analysis of reflective APIs
 
Garbage Collector Tuning
Garbage Collector TuningGarbage Collector Tuning
Garbage Collector Tuning
 
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame CaseImproving Performance Through Object Lifetime Profiling: the DataFrame Case
Improving Performance Through Object Lifetime Profiling: the DataFrame Case
 
Pharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and FuturePharo DataFrame: Past, Present, and Future
Pharo DataFrame: Past, Present, and Future
 
thisContext in the Debugger
thisContext in the DebuggerthisContext in the Debugger
thisContext in the Debugger
 
Websockets for Fencing Score
Websockets for Fencing ScoreWebsockets for Fencing Score
Websockets for Fencing Score
 
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScriptShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
ShowUs: PharoJS.org Develop in Pharo, Run on JavaScript
 
Advanced Object- Oriented Design Mooc
Advanced Object- Oriented Design MoocAdvanced Object- Oriented Design Mooc
Advanced Object- Oriented Design Mooc
 
A New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and TransformationsA New Architecture Reconciling Refactorings and Transformations
A New Architecture Reconciling Refactorings and Transformations
 

Último

Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...FIDO Alliance
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreelreely ones
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastUXDXConf
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoUXDXConf
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2DianaGray10
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeCzechDreamin
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfFIDO Alliance
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty SecureFemke de Vroome
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCzechDreamin
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxDavid Michel
 

Último (20)

Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
THE BEST IPTV in GERMANY for 2024: IPTVreel
THE BEST IPTV in  GERMANY for 2024: IPTVreelTHE BEST IPTV in  GERMANY for 2024: IPTVreel
THE BEST IPTV in GERMANY for 2024: IPTVreel
 
Designing for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at ComcastDesigning for Hardware Accessibility at Comcast
Designing for Hardware Accessibility at Comcast
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi IbrahimzadeFree and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
Free and Effective: Making Flows Publicly Accessible, Yumi Ibrahimzade
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptxUnpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
Unpacking Value Delivery - Agile Oxford Meetup - May 2024.pptx
 

PHANtom: A Modern Aspect Language for Pharo

  • 1. PHANtom: A Modern Aspect Language for Pharo Johan Fabry, Daniel Galdames. PLEIAD Lab, DCC - Universidad de Chile
  • 2. AOP ?? Johan Fabry 2
  • 3. AOP ?? Cross-cutting concerns Aspect = module ‣ Behavior = WHAT = advice ‣ Quantification = WHEN = pointcuts Running application = stream of join points ‣ ST computation = messages ‣ In PHANtom: method exec Johan Fabry 2
  • 4. AOP ?? Cross-cutting concerns Aspect = module ‣ Behavior = WHAT = advice ‣ Quantification = WHEN = pointcuts Running application = stream of join points ‣ ST computation = messages ‣ In PHANtom: method exec Johan Fabry 2
  • 5. AOP ?? Cross-cutting concerns Aspect = module ‣ Behavior = WHAT = advice ‣ Quantification = WHEN = pointcuts Running application = stream of join points ‣ ST computation = messages ‣ In PHANtom: method exec Johan Fabry 2
  • 6. AOP ?? Cross-cutting concerns Aspect = module ‣ Behavior = WHAT = advice ‣ Quantification = WHEN = pointcuts Running application = stream of join points ‣ ST computation = messages ‣ In PHANtom: method exec Johan Fabry 2
  • 7. AOP ?? Cross-cutting concerns Aspect = module ‣ Behavior = WHAT = advice ‣ Quantification = WHEN = pointcuts Running application = stream of join points ‣ ST computation = messages ‣ In PHANtom: method exec Johan Fabry 2
  • 8. In the spirit of Smalltalk Dynamic Simple Powerful Johan Fabry 3
  • 9. In the spirit of Smalltalk Dynamic Dynamic AOP Simple Powerful Johan Fabry 3
  • 10. In the spirit of Smalltalk Dynamic Dynamic AOP Develop normally Simple Powerful Johan Fabry 3
  • 11. In the spirit of Smalltalk Dynamic Dynamic AOP Develop normally Simple Powerful Minimal set of Constructs Johan Fabry 3
  • 12. In the spirit of Smalltalk Dynamic Dynamic AOP Develop normally Simple Powerful Minimal set of Constructs Uniform / no restrictions Johan Fabry 3
  • 13. In the spirit of Smalltalk Dynamic Dynamic AOP Develop normally Simple Powerful Minimal set of Constructs First-class everything Uniform / no restrictions Johan Fabry 3
  • 14. In the spirit of Smalltalk Dynamic Dynamic AOP Develop normally Simple Powerful Minimal set of Constructs First-class everything Uniform / no restrictions New language features Johan Fabry 3
  • 15. Pointcuts Dyn Sim Pow Johan Fabry 4
  • 16. Pointcuts PhPointcut receivers: 'TestCase' selectors: 'assert:' Dyn Sim Pow Johan Fabry 4
  • 17. Pointcuts PhPointcut receivers: 'TestCase' selectors: 'assert:' PhPointcut receivers: 'TestCase+' selectors: #(assert: assert:equals:) Dyn Sim Pow Johan Fabry 4
  • 18. Pointcuts PhPointcut receivers: 'TestCase' selectors: 'assert:' PhPointcut receivers: 'TestCase+' selectors: #(assert: assert:equals:) context: #(receiver sender arguments) Dyn Sim Pow Johan Fabry 4
  • 19. Pointcuts PhPointcut receivers: 'TestCase' selectors: 'assert:' PhPointcut receivers: 'TestCase+' selectors: #(assert: assert:equals:) context: #(receiver sender arguments) PhPointcut receivers: 'Test*' selectors: #(assert: assert:_: assert:_:_:) Dyn context: #(receiver) restrict: #(Tests_Mine) Sim Pow Johan Fabry 4
  • 20. Advice Dyn Sim Pow Johan Fabry 5
  • 21. Advice PhAdvice pointcut: pc send: #incCount: to: self type: #after Dyn Sim Pow Johan Fabry 5
  • 22. Advice PhAdvice pointcut: pc send: #incCount: to: self type: #after PhAdvice pointcut: pc advice: [:ctx | Transcript show: (ctx receiver asString);cr. ctx proceed.]] Dyn type: #around. Sim Pow Johan Fabry 5
  • 23. Inter-Type Declaration Dyn Sim Pow Johan Fabry 6
  • 24. Inter-Type Declaration PhClassModifier on: ACTestCase addIV: 'phacount' Dyn Sim Pow Johan Fabry 6
  • 25. Inter-Type Declaration PhClassModifier on: ACTestCase addIV: 'phacount' PhClassModifier on: ACTestCase addIM: 'phacount ↑phacount ifNil: [phacount := 0]' Dyn Sim Pow Johan Fabry 6
  • 26. Aspect PHAspect subclass: MyAspect ... (Object subclass: #PhAspect ...) Add PHAdvice and PHClassModifier instances Send install to activate Send uninstall to deactivate Dyn Sim Pow Johan Fabry 7
  • 27. What happens here? |asp| asp := PhAspect new add: (PhAdvice pointcut: (PhPointcut receivers: 'Transcript class' selectors: 'show:') advice: [ Transcript show: 'Have '] type: #before). asp install. Transcript show: 'reentrancy control'; cr Johan Fabry 8
  • 28. What happens here? |asp| asp := PhAspect new add: (PhAdvice pointcut: (PhPointcut receivers: 'Transcript class' selectors: 'show:') advice: [ Transcript show: 'Have '] type: #before). asp install. Transcript show: 'reentrancy control'; cr Johan Fabry 8
  • 29. What happens here? |asp| asp := PhAspect new add: (PhAdvice pointcut: (PhPointcut receivers: 'Transcript class' selectors: 'show:') advice: [ Transcript show: 'Have '] type: #before). asp install. Transcript show: 'reentrancy control'; cr Johan Fabry 8
  • 30. What happens here? |asp| asp := PhAspect new add: (PhAdvice pointcut: (PhPointcut receivers: 'Transcript class' selectors: 'show:') advice: [ Transcript show: 'Have '] type: #before). asp install. Transcript show: 'reentrancy control'; cr Johan Fabry 8
  • 31. What happens here? |asp| asp := PhAspect new add: (PhAdvice pointcut: (PhPointcut receivers: 'Transcript class' selectors: 'show:') advice: [ Transcript show: 'Have '] type: #before). asp install. Transcript show: 'reentrancy control'; cr Johan Fabry 8
  • 32. What happens here? |asp| asp := PhAspect new add: (PhAdvice pointcut: (PhPointcut receivers: 'Transcript class' selectors: 'show:') advice: [ Transcript show: 'Have '] type: #before). asp install. Transcript show: 'reentrancy control'; cr Johan Fabry 8
  • 33. What happens here? |asp| asp := PhAspect new add: (PhAdvice pointcut: (PhPointcut receivers: 'Transcript class' selectors: 'show:') advice: [ Transcript show: 'Have '] type: #before). asp install. Transcript show: 'reentrancy control'; cr Johan Fabry 8
  • 34. What happens here? |asp| OM asp := PhAspect new add: (PhAdvice pointcut: (PhPointcut receivers: 'Transcript class' selectors: 'show:') advice: [ Transcript show: 'Have '] type: #before). BO asp install. Transcript show: 'reentrancy control'; cr Johan Fabry 8
  • 35. Reentrancy control PHANtom: no problem! ‣ Aspect execution by default NOT MATCHED More power if you want it: Membranes [Tanter & Tabareau] Use membranes to control ‣ join point emission and capture scope ‣ aspect observing join points Dyn Sim Pow Johan Fabry 9
  • 36. Advice ordering Multiple advice 1 join point “Classic”: advice precedence ‣ Global and static PHANtom deployment precedence ‣ Global and ‘static’ ‣ Complement or override on pointcut PHANtom dynamic precedence in the advice ‣ OrderedCollection of PHAdvice instances ‣ get from context Dyn ‣ set on context Sim Pow Johan Fabry 10
  • 37. Not in the paper ... TDD ‣ 155 tests ‣ 90+% coverage Johan Fabry 11
  • 38. Not in the paper ... TDD ‣ 155 tests ‣ 90+% coverage Johan Fabry 11
  • 39. Future work Optimize the implementation Compile PHANtom code Infrastructure for Domain-Specific Aspect Languages Johan Fabry 12