Lub: a DSL for Dynamic Context Oriented Programming
Transcript of Lub: a DSL for Dynamic Context Oriented Programming
![Page 1: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/1.jpg)
LubA language for Dynamic Context
Oriented Programming
Steven CostiouMickaël Kerboeuf, Glenn Cavarlé, Alain Plantec
UMR CNRS 6285, Lab-STICC/MOCSUniversité de Bretagne Occidentale
![Page 2: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/2.jpg)
Drone 1 + GPSDrone 2 + GPS
Target
![Page 3: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/3.jpg)
Drone 2 NO GPS
GPS loss
Drone 1 + GPS
![Page 4: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/4.jpg)
Unanticipated
![Page 5: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/5.jpg)
Unanticipated =
Not foreseen at design time
![Page 6: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/6.jpg)
Unanticipated =
Not foreseen at design time=
The behavior we need was not expected
![Page 7: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/7.jpg)
▪ Schéma 4 : Adaptation proposition
GPS sharing
Drone 1 + GPS
Drone 2 NO GPS
![Page 8: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/8.jpg)
Unanticipated behavior adaptation at runtime
![Page 9: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/9.jpg)
Minimal anticipation
![Page 10: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/10.jpg)
Minimal anticipation=
Anticipate the need to face unanticipated adaptation
![Page 11: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/11.jpg)
Minimal anticipation=
Anticipate the need to face unanticipated adaptation
=Build Support (frameworks)
![Page 12: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/12.jpg)
Dynamic context oriented programming (COP)
![Page 13: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/13.jpg)
What we adapt:Objects
![Page 14: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/14.jpg)
● Instance based adaptation
● Adapted object preserve their identity
![Page 15: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/15.jpg)
How do we adapt ?
![Page 16: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/16.jpg)
● Free adaptation strategy
● Easy and controlled behavior selection
![Page 17: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/17.jpg)
LUBAn extension of Pharo
![Page 18: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/18.jpg)
Behavior adaptation through dynamic lookup control
![Page 19: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/19.jpg)
#pinPoint
![Page 20: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/20.jpg)
Lookup base
#pinPoint
![Page 21: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/21.jpg)
Lookup starts in the object’s lookup base
Lookup
#pinPoint
![Page 22: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/22.jpg)
![Page 23: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/23.jpg)
New lookup base
![Page 24: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/24.jpg)
lub := LookupBase named: ‘PeerTrackerLookupBase’ targetClass: PeerPositionTracker
![Page 25: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/25.jpg)
![Page 26: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/26.jpg)
bind
![Page 27: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/27.jpg)
positionTracker lookupBase: lub.
positionTracker pinPoint
lub := LookupBase named: ‘PeerTrackerLookupBase’ targetClass: PeerPositionTracker
![Page 28: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/28.jpg)
#pinPoint
![Page 29: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/29.jpg)
#pinPoint
![Page 30: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/30.jpg)
does-not-understand
#pinPoint
![Page 31: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/31.jpg)
does-not-understand
#pinPoint
![Page 32: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/32.jpg)
Selection of the behavior to adapt ?
![Page 33: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/33.jpg)
lub := LookupBase named: ‘PeerTrackerLookupBase’ targetClass: PeerPositionTracker with: #(#pinPoint).
positionTracker lookupBase: lub.
positionTracker pinPoint.positionTracker position.
![Page 34: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/34.jpg)
![Page 35: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/35.jpg)
#pinPoint
![Page 36: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/36.jpg)
#position
![Page 37: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/37.jpg)
● Instance based adaptation
● Adapted object preserve their identity
Binding an object to a meta object that controls the lookup
● Free adaptation strategy
● Easy and controlled behavior selection
![Page 38: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/38.jpg)
Issues ?
![Page 39: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/39.jpg)
States consistency with an adaptation ?
![Page 40: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/40.jpg)
pinpoint^peerTracker pinPoint
![Page 41: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/41.jpg)
Validation and consistency of the adapted behavior ?
![Page 42: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/42.jpg)
Experiments on a physical device ?
![Page 43: Lub: a DSL for Dynamic Context Oriented Programming](https://reader033.fdocuments.net/reader033/viewer/2022042907/5872fed51a28ab8c718b7d2f/html5/thumbnails/43.jpg)
LubA language for Dynamic Context
Oriented Programming
Steven CostiouMickaël Kerboeuf, Glenn Cavarlé, Alain Plantec
UMR CNRS 6285, Lab-STICC/MOCSUniversité de Bretagne Occidentale