towards an aspect-oriented language module: aspects for petri nets tim molderez, bart meyers, dirk...
DESCRIPTION
Introduction Initial step towards an AO language module: Start with something completely different than commonly used base languages (e.g. Java) … Petri nets! Non-deterministic, minimal and a different purpose How do typical AOP features work for Petri nets? Design the AOP extension in a modular fashion 3TRANSCRIPT
![Page 1: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/1.jpg)
Towards an Aspect-oriented Language Module:Aspects for Petri Nets
Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe
AnsymoAntwerp Systems and Software Modelling
![Page 2: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/2.jpg)
2
Introduction Building a language from scratch is a large effort:
Construct languages by composing modules
Aspect-oriented versions of many
different languages
→What about an “aspect-oriented language module”?• Using the module will add aspect-oriented features to your language
![Page 3: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/3.jpg)
3
Introduction Initial step towards an AO language module:
Start with something completely different than
commonly used base languages (e.g. Java)
… Petri nets!• Non-deterministic, minimal and a different purpose
How do typical AOP features work for Petri nets?
Design the AOP extension in a modular fashion
![Page 4: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/4.jpg)
4
Running example
P5-P8: represent rooms of a building
«enter», «exit» stereotypes: entrances and exits
Invariant: There may never be more than 30 people inside at the same time.
![Page 5: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/5.jpg)
5
Running example
VisitorCounter aspect: Keeps track of how many people are in the building
WaitingLine aspect: Prevents access if the building is full
and directs these people to a waiting line
![Page 6: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/6.jpg)
6
AOPN extension overview
Base language (PN) Join point model
Pointcut languageAdvice language
Weaver Composition mechanism
![Page 7: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/7.jpg)
7
Join point model Whenever a transition is about to fire.
Not affected by non-determinism:• Petri net execution has already chosen/determined among all
enabled transitions which one will be fired.
![Page 8: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/8.jpg)
8
Weaver1. When a join point is reached, pause Petri net execution.
2. Find all matching pointcuts, given the current state.
3. Use the composition mechanism to arrange the matched
pointcuts in the right order.
4. Insert all corresponding advice into the Petri net, in the
composition order.
5. Resume Petri net execution.
![Page 9: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/9.jpg)
9
![Page 10: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/10.jpg)
10
VisitorCounter aspect
Keeps track of the number of people in the building
![Page 11: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/11.jpg)
11
increaseOnEnter pointcut-advice pair
Tracks all people entering
![Page 12: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/12.jpg)
12
transition pointcut construct
Captures all instances of transitions by name or stereotype
![Page 13: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/13.jpg)
13
Introductions: Allow places to be shared across advice instances and aspects
Introduced places can be a singleton, or per transition
![Page 14: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/14.jpg)
14
Input-output place binding
![Page 15: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/15.jpg)
15
Advice insertion in 3 steps: What happens if increaseOnEnter matches on
T1
![Page 16: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/16.jpg)
16
Simple AspectJ-like precedence mechanism
![Page 17: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/17.jpg)
17
pertransition introduction: One waiting line per entrance
![Page 18: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/18.jpg)
18
tokens pointcut construct: If the building is
full
![Page 19: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/19.jpg)
19
Proceed transition: If multiple pointcuts match, insert
the next advice at the proceed transition
No proceed transition: To prevent a transition from firing
![Page 20: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/20.jpg)
20
Demo
![Page 21: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/21.jpg)
21
Conclusion Initial step towards an AO language module:
Aspect-oriented Petri nets
Future work• Study other base languages to refine concept of language module• Define the interactions between the module’s components• How does adding aspect affect Petri nets’ use for analysis• Petri nets suitable language to study interactions among aspects
Download this presentation at: http://tinyurl.com/dsal12aopn
Contact: [email protected], [email protected] | http://ansymo.ua.ac.be
![Page 22: Towards an Aspect-oriented Language Module: Aspects for Petri Nets Tim Molderez, Bart Meyers, Dirk Janssens and Hans Vangheluwe Ansymo Antwerp Systems](https://reader035.vdocument.in/reader035/viewer/2022081605/5a4d1ad47f8b9ab0599728d6/html5/thumbnails/22.jpg)
22
Mapping to Petri nets
No advice
Never applies
increaseOnEnte
r
If building not full
decreaseOnEnte
r
Always applies
moveToWaitingLine
+ increaseOnEnter /
preventEntrance
If building full