![Page 1: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/1.jpg)
ASPECT-ORIENTED MODELING
Patricia Derler
![Page 2: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/2.jpg)
Patricia Derler
MOTIVATION
2
Functional Model
![Page 3: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/3.jpg)
Patricia Derler
MOTIVATION
2
Functional Model
Distribution onto different platforms
Communication infrastructure Execution Time
Power Usage
Exploration of system behavior
under faults
Exploration of system behavior
under security attacks
LoggingCost
Aspects
Aspects…
![Page 4: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/4.jpg)
Patricia Derler
A LITTLE BIT OF HISTORY
Object-oriented programming
Actor-oriented programming
Aspect-oriented programming
sequential concurrent
data messagesseparation of concerns into distinct objects crosscutting
concerns
Conventional programmingglobal data
objects encapsulate data
Aspect-oriented modeling
Aspect-oriented programming, G Kiczales, J Lamping, A Mendhekar, C Maeda, C Lopes, JM Loingtier, J Irwin,
ECOOP’97—Object-Oriented Programming, 220-242inspired by Alberto L. Sangiovanni-Vincentelli, Quo Vadis
SLD: Reasoning about Trends and Challenges of System-Level Design, Proceedings of the IEEE, 95(3):467-506, March 2007.
Threadsconcurrent
Edward A. Lee. 2006. The Problem with Threads. Computer 39, 5 (May 2006), 33-42. DOI=10.1109/
MC.2006.180 http://dx.doi.org/10.1109/MC.2006.180
sequential
2
![Page 5: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/5.jpg)
Patricia Derler
ASPECT-ORIENTED PROGRAMMING
• Reduce code duplication/tangling/scattering
• Examples: Logging, security, transaction management
• Various implementations
by Anonymous
Fabiano Ferrari, Rachel Burrows, Otávio Lemos, Alessandro Garcia, Eduardo Figueiredo, Nelio Cacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study of fault-proneness in evolving aspect-oriented programs. In Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering - Volume 1 (ICSE '10), Vol. 1. ACM, New York, NY, USA, 65-74. DOI=10.1145/1806799.1806813 http://doi.acm.org/10.1145/1806799.1806813
Haihan Yin, Christoph Bockisch, and Mehmet Aksit. 2012. A fine-grained debugger for aspect-oriented programming. In Proceedings of the 11th annual international conference on Aspect-oriented Software Development (AOSD '12). ACM, New York, NY, USA, 59-70. DOI=10.1145/2162049.2162057 http://doi.acm.org/10.1145/2162049.2162057
• Slow adoption
• Debugging of AOP is hard
• Studies on fault-proneness in AOP
3
![Page 6: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/6.jpg)
Patricia Derler
COMMUNICATION• Cross-cutting concern in actor-oriented
models of CPS Networks and Communication
5
![Page 7: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/7.jpg)
Patricia Derler
COMMUNICATION• Cross-cutting concern in actor-oriented
models of CPS Networks and Communication
All communication between plant and controllers is done via a shared
5
![Page 8: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/8.jpg)
Patricia Derler
COMMUNICATION
• Original Model • Entangled Model
6
![Page 9: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/9.jpg)
Patricia Derler
COMMUNICATION• Cross-cutting concern in actor-oriented
models of CPS Networks and Communication
•Model communication network
•“Somehow” associate connections with communication resource
7
Aspect-oriented modeling
![Page 10: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/10.jpg)
Patricia Derler
DECORATOR MECHANISM
• Defines objects to decorate (e.g. actors, ports)
• Creates attributes for each decorated object
… behavior to be added to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class … Wikipedia
/*@author Bert Rodiers@author Edward A. Lee*/!public interface Decorator
8
![Page 11: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/11.jpg)
Patricia Derler
DECORATOR MECHANISM
java ptolemy.vergil.VergilApplication ptolemy/demo/ElectricPowerSystem/PlantControllerDecorator.xml
9
DEMOjava ptolemy.vergil.VergilApplication ptolemy/demo/ElectricPowerSystem/PlantController.xml
![Page 12: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/12.jpg)
Patricia Derler
COMMUNICATION• Cross-cutting concern in actor-oriented
models of CPS Networks and Communication
java ptolemy.vergil.VergilApplication ptolemy/demo/ElectricPowerSystem/PlantControllerBus.xml10
DEMOjava ptolemy.vergil.VergilApplication ptolemy/demo/ElectricPowerSystem/PlantControllerBus1.xml
![Page 13: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/13.jpg)
Patricia Derler
COMMUNICATION ASPECTS• If a communication between two actors
is mediated by a communication aspect
• An intermediate receiver is created wrapping the original receiver
• The intermediate receiver receives tokens from the sender
• The intermediate receiver sends tokens to the aspect
• The aspect forwards tokens to the original receiver
• Multiple communication aspects possibleA1 A2A1 p1 p2Actor Port
send token
put token to receiver
Receiver
get token
Intermediate Receiver
CA
Communication Aspect
send to aspect
send to wrapped receiver
CA’
11
![Page 14: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/14.jpg)
Patricia Derler
COMMUNICATION ASPECTS
Atomic Communication
Aspect
Composite Communication
Aspect
Communication Aspect
Decorator
12
![Page 15: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/15.jpg)
Patricia Derler
COMMUNICATION ASPECTS
Atomic Communication
Aspect
Composite Communication
Aspect
Communication Aspect
Decorator
AFDXSwitch
by Janette Cardoso, Gilles Lasnier, David Marciano
from ISAE, Toulouse
AFDXEndsystem
• Communication Modeling
BasicSwitch, CrossbarSwitch,
TTESwitch
12
![Page 16: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/16.jpg)
Patricia Derler
COMMUNICATION ASPECTS
Atomic Communication
Aspect
Composite Communication
Aspect
Communication Aspect
Decorator
AFDXSwitch
by Janette Cardoso, Gilles Lasnier, David Marciano
from ISAE, Toulouse
AFDXEndsystem
• Communication Modeling
BasicSwitch, CrossbarSwitch,
TTESwitch
• Other communication aspects: • Logging • Fault models • Security modeling
12
![Page 17: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/17.jpg)
Patricia Derler
• Cross-cutting concerns
• Communication !
• Execution !
• Logging and debugging !
• Error modeling - Ilge Akkaya !
• Security - Armin Wasicek
ASPECT-ORIENTED MODELING & CPS
CPU
executionTime = 0.1
executionTime = 0.5
13
![Page 18: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/18.jpg)
Patricia Derler
• Cross-cutting concerns
• Communication !
• Execution !
• Logging and debugging !
• Error modeling - Ilge Akkaya !
• Security - Armin Wasicek
ASPECT-ORIENTED MODELING & CPS
CPU CPU
executionTime = 0.1
executionTime = 0.5
13
![Page 19: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/19.jpg)
Patricia Derler
• Cross-cutting concerns
• Communication !
• Execution !
• Logging and debugging !
• Error modeling - Ilge Akkaya !
• Security - Armin Wasicek
ASPECT-ORIENTED MODELING & CPS
java ptolemy.vergil.VergilApplication ptolemy/demo/ElectricPowerSystem/PlantControllerProcessor.xml13
DEMO
![Page 20: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/20.jpg)
Patricia Derler
ASPECT-ORIENTED MODELING & CPS
• Cross-cutting concerns
• Communication !
• Execution !
• Logging and debugging !
• Error modeling - Ilge Akkaya !
• Security - Armin Wasicek
Execution Log: Sensor1 Controller 1 Controller 2 Actuator 2 Sensor 3 Actuator 2 Controller 3 Controller 3
Message Log: 0.00021 342 1 true 3.223 069996 0299, 49304,
13
![Page 21: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/21.jpg)
Patricia Derler
ASPECT-ORIENTED MODELING & CPS
• Cross-cutting concerns
• Communication !
• Execution !
• Logging and debugging !
• Error modeling - Ilge Akkaya !
• Security - Armin Wasicek
13
Aspect-Oriented Fault Modeling and Anomaly
Detection
![Page 22: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/22.jpg)
Patricia Derler
ASPECT-ORIENTED MODELING & CPS
• Cross-cutting concerns
• Communication !
• Execution !
• Logging and debugging !
• Error modeling - Ilge Akkaya !
• Security - Armin Wasicek
13
Attack Modeling in Ptolemy: Towards a Secure Design for
Cyber-Physical Systems
![Page 23: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/23.jpg)
Patricia Derler
CURRENT STATE AND FUTURE WORK
• Communication aspects
!
!
• Execution aspects
!
!
• Aspects work in a small set of Models of Computations (DE, Continuous, Ptides, SDF)
14
![Page 24: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/24.jpg)
Patricia Derler
CURRENT STATE AND FUTURE WORK
• Communication aspects
!
!
• Execution aspects
!
!
• Aspects work in a small set of Models of Computations (DE, Continuous, Ptides, SDF)
14
![Page 25: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/25.jpg)
Patricia Derler
CURRENT STATE AND FUTURE WORK
• Communication aspects
!
!
• Execution aspects
!
!
• Aspects work in a small set of Models of Computations (DE, Continuous, Ptides, SDF)
14
![Page 26: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/26.jpg)
Patricia Derler
CURRENT STATE AND FUTURE WORK
• Communication aspects
!
!
• Execution aspects
!
!
• Aspects work in a small set of Models of Computations (DE, Continuous, Ptides, SDF)
14
![Page 27: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/27.jpg)
Patricia Derler
CURRENT STATE AND FUTURE WORK
• Support for other MoCs
!
• Additional aspects:
• Initialization aspect
• After-actor-execution aspect
15
![Page 28: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/28.jpg)
Patricia Derler
THANKS
16
![Page 29: ASPECT-ORIENTED MODELINGCacho, Frederico Lopes, Nathalia Temudo, Liana Silva, Sergio Soares, Awais Rashid, Paulo Masiero, Thais Batista, and José Maldonado. 2010. An exploratory study](https://reader035.vdocument.in/reader035/viewer/2022081411/60ad8005491cc1211d360c70/html5/thumbnails/29.jpg)
Patricia Derler
EXECUTION ASPECTS
• DE Director
• get event with smallest timestamp
• fire actor corresponding to event
• SDF Director
• compute static schedule
• execute next actor in schedule
contact EA
contact EA
A1 A2A1 p1 p2Actor Port
Director
EA
Execution Aspect
fire actor
request execution of actor A1
grant execution of actor A1fire actor