Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and...
Transcript of Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and...
![Page 1: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/1.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
Model Driven Context Aware Reactive Applications
Tony Clark (with Dean Kramer and Samia Oussena, UWL)
School of Engineering and Information Sciences, Middlesex University
October 5, 2011
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 2: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/2.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Contents
1 CARA ApplicationsDefinitionsResearchCase Study
2 ModellingDiagramsWidget Calculus
3 Case Study Model
4 Other IssuesTypesImplementation
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 3: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/3.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Context Aware Reactive Applications
Context aware applications are: intelligent applicationsthat can monitor the user’s context and, in case ofchanges in this context, consequently adapt theirbehaviour in order to satisfy the user’s current needs oranticipate the user’s intentions.
L.M. Daniele, E. Silva, L.F. Pires, and M. Sinderen. A SOA-based Platform-
specfic Framework for Context-Aware Mobile Applications. Enterprise
Interoperability, 2009.
Reactive applications must deal with events that arereceived from their environment and react accordingly.
D. Harel and A. Pnueli. On the development of reactive systems. Weizmann
Institute of Science, Dept. of Computer Science, 1985.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 4: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/4.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
The Rise of CARA
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 5: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/5.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
The Rise of CARA
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 6: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/6.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
The Rise of CARA
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 7: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/7.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Model Driven Development
Use models as the primary system artifact.
Focus on key aspects of systems.
Use standards to support interoperability and tools.
Use meta-modelling to construct domain-specific abstractions.
Analyse, verify and validate the models.
Generate (parts of) the system from models.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 8: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/8.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Knowledge Connext and KTP
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 9: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/9.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Knowledge Connext and KTP
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 10: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/10.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Problem and Proposal
MDD should be available for CARA applications - right?
Some attempts:
Complex or tool specific.Incomplete, lacks execution.
Can we design a simple, universal MDD solution?
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 11: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/11.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Problem and Proposal
MDD should be available for CARA applications - right?
Some attempts:
Complex or tool specific.Incomplete, lacks execution.
Can we design a simple, universal MDD solution?
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 12: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/12.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Problem and Proposal
MDD should be available for CARA applications - right?
Some attempts:
Complex or tool specific.
Incomplete, lacks execution.
Can we design a simple, universal MDD solution?
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 13: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/13.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Problem and Proposal
MDD should be available for CARA applications - right?
Some attempts:
Complex or tool specific.Incomplete, lacks execution.
Can we design a simple, universal MDD solution?
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 14: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/14.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Problem and Proposal
MDD should be available for CARA applications - right?
Some attempts:
Complex or tool specific.Incomplete, lacks execution.
Can we design a simple, universal MDD solution?
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 15: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/15.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
CARA Overview
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 16: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/16.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Buddy
Mobile phones have address lists.
A phone is always in contact with its network provider.
Each phone has a unique address, e.g. [email protected].
Each phone maintains a database of contacts.
Users want to know about contacts in their database that areco-located.
When one phone moves into the vicinity of the other thenboth phones are told of the availability of the other in termsof the contact address.
If the address is in the user’s database then the phone flashesthe contact.
L. Daniele, L. Ferreira Pires, and M. van Sinderen. An MDA-based Approach
for Behaviour Modelling of Context-aware Mobile Applications. In Model
Driven Architecture-Foundations and Applications. Springer, 2009.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 17: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/17.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Buddy
Mobile phones have address lists.
A phone is always in contact with its network provider.
Each phone has a unique address, e.g. [email protected].
Each phone maintains a database of contacts.
Users want to know about contacts in their database that areco-located.
When one phone moves into the vicinity of the other thenboth phones are told of the availability of the other in termsof the contact address.
If the address is in the user’s database then the phone flashesthe contact.
L. Daniele, L. Ferreira Pires, and M. van Sinderen. An MDA-based Approach
for Behaviour Modelling of Context-aware Mobile Applications. In Model
Driven Architecture-Foundations and Applications. Springer, 2009.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 18: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/18.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Buddy
Mobile phones have address lists.
A phone is always in contact with its network provider.
Each phone has a unique address, e.g. [email protected].
Each phone maintains a database of contacts.
Users want to know about contacts in their database that areco-located.
When one phone moves into the vicinity of the other thenboth phones are told of the availability of the other in termsof the contact address.
If the address is in the user’s database then the phone flashesthe contact.
L. Daniele, L. Ferreira Pires, and M. van Sinderen. An MDA-based Approach
for Behaviour Modelling of Context-aware Mobile Applications. In Model
Driven Architecture-Foundations and Applications. Springer, 2009.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 19: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/19.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Buddy
Mobile phones have address lists.
A phone is always in contact with its network provider.
Each phone has a unique address, e.g. [email protected].
Each phone maintains a database of contacts.
Users want to know about contacts in their database that areco-located.
When one phone moves into the vicinity of the other thenboth phones are told of the availability of the other in termsof the contact address.
If the address is in the user’s database then the phone flashesthe contact.
L. Daniele, L. Ferreira Pires, and M. van Sinderen. An MDA-based Approach
for Behaviour Modelling of Context-aware Mobile Applications. In Model
Driven Architecture-Foundations and Applications. Springer, 2009.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 20: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/20.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Buddy
Mobile phones have address lists.
A phone is always in contact with its network provider.
Each phone has a unique address, e.g. [email protected].
Each phone maintains a database of contacts.
Users want to know about contacts in their database that areco-located.
When one phone moves into the vicinity of the other thenboth phones are told of the availability of the other in termsof the contact address.
If the address is in the user’s database then the phone flashesthe contact.
L. Daniele, L. Ferreira Pires, and M. van Sinderen. An MDA-based Approach
for Behaviour Modelling of Context-aware Mobile Applications. In Model
Driven Architecture-Foundations and Applications. Springer, 2009.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 21: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/21.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Buddy
Mobile phones have address lists.
A phone is always in contact with its network provider.
Each phone has a unique address, e.g. [email protected].
Each phone maintains a database of contacts.
Users want to know about contacts in their database that areco-located.
When one phone moves into the vicinity of the other thenboth phones are told of the availability of the other in termsof the contact address.
If the address is in the user’s database then the phone flashesthe contact.
L. Daniele, L. Ferreira Pires, and M. van Sinderen. An MDA-based Approach
for Behaviour Modelling of Context-aware Mobile Applications. In Model
Driven Architecture-Foundations and Applications. Springer, 2009.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 22: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/22.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Buddy
Mobile phones have address lists.
A phone is always in contact with its network provider.
Each phone has a unique address, e.g. [email protected].
Each phone maintains a database of contacts.
Users want to know about contacts in their database that areco-located.
When one phone moves into the vicinity of the other thenboth phones are told of the availability of the other in termsof the contact address.
If the address is in the user’s database then the phone flashesthe contact.
L. Daniele, L. Ferreira Pires, and M. van Sinderen. An MDA-based Approach
for Behaviour Modelling of Context-aware Mobile Applications. In Model
Driven Architecture-Foundations and Applications. Springer, 2009.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 23: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/23.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Tony’s Phone
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 24: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/24.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Tony Knows Sally
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 25: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/25.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DefinitionsResearchCase Study
Context Aware
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 26: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/26.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Contents
1 CARA ApplicationsDefinitionsResearchCase Study
2 ModellingDiagramsWidget Calculus
3 Case Study Model
4 Other IssuesTypesImplementation
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 27: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/27.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Domain Analysis
GUI Trees GUI elements are organized in trees.
Events Elements generate events and listeners handle them.
Platform Each platform provides a different collection of eventgenerators.
Object-Orientation Implementation technologies are mostly OO.
Transitional Behaviour Application execute by performing statetransitions.
Data Persistence Applications manage simple databases.
Static Typing Generally lacked by most implementationtechnologies for platforms.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 28: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/28.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
UML Profile
<<external>> Application components supplied by platform.
<<widget>> User defined components, tree-shaped.
Containership Associations, black-diamond.
Root Root containers define application states.
<<event>> Generated by the platform, context events.
<<handler>> Process events.
Machines State transitions.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 29: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/29.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Single Button Model
context Push i n v :label = ’PUSHME ’
xTony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 30: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/30.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle Button Model
context Main1 i n v :display.label = ’PUSHME ’
context Main2 i n v :display.label = ’PUSHED ’
x
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 31: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/31.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Widget Calculus: Key Features
Take a standard λ-calculus and add:
widgets tree-structured records that generate and handleevents.
externals each platform provides some built-in widgets.
commands change the state of the world.
methods each external provides some built-in commands.
cycle eval, command, wait
CARA models translate onto the widget-calculus. The calculusprovides the action-language for the models.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 32: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/32.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
A Button (1)
events ids eval
0<-push(0)
main =
widget self (screen (50,50,50,50, push)) {
move(x,y) = do { r e tu rn self }
};
push =
widget self (button(’PUSHME ’)) {
push(i) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 33: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/33.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
A Button (2)
events ids command
0<-push(0)
<widget self (screen (50,50,50,50,
widget self (button(’PUSHME ’)) {
push(i) = do { r e tu rn self }
}) {
move(x,y) = do { r e tu rn self }
}>
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 34: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/34.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
A Button (3)
events ids wait
0<-push(0) 0 1
2 3
widget (3) self (screen (2,50,50,50,50,
widget (1) self (button(0,’PUSHME ’)) {
push(i) = do { r e tu rn self }
}) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 35: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/35.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
A Button (4)
events ids eval
0 1
2 3
widget (3) self (screen (2,50,50,50,50,
<widget (1) self (button(0,’PUSHME ’)) {
push(i) = do { r e tu rn self }
}.push (0)>) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 36: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/36.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
A Button (5)
events ids command
0 1
2 3
widget (3) self (screen (2,50,50,50,50,
<do {
r e tu rn widget (1) self (button(0,’PUSHME ’)) {
push(i) = do { r e tu rn self }
}
}>) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 37: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/37.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
A Button (6)
events ids wait
0 1
2 3
widget (3) self (screen (2,50,50,50,50,
widget (1) self (button(0,’PUSHME ’)) {
push(i) = do { r e tu rn self }
}) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 38: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/38.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (1)
events ids eval
0<-push(0)
1<-push(1)
main =
widget self (screen (50,50,50,50, push)) {
move(x,y) = do { r e tu rn self }
};
push =
widget (button(’PUSHME ’)) {
push(i) = do { r e tu rn pushed }
};
pushed =
widget (button(’PUSHED ’)) {
push(i) = do { r e tu rn push }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 39: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/39.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (2)
events ids command
0<-push(0)
1<-push(1)
<widget self (screen (50,50,50,50,
widget (button(’PUSHME ’)) {
push(i) = do {
r e tu rn widget (button(’PUSHED ’)) {
push(i) = do { r e tu rn push }
}
}
})) {
move(x,y) = do { r e tu rn self }
}>
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 40: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/40.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (3)
events ids wait
0<-push(0)
1<-push(1)0
1
2
3
4
5
widget (5) self (screen (4,50,50,50,50,
widget (3) (button(0,’PUSHME ’)) {
push(i) = do {
r e tu rn widget (2) (button(1,’PUSHED ’)) {
push(i) = do { r e tu rn push }
}
}
})) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 41: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/41.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (4)
events ids eval
1<-push(1) 0
1
2
3
4
5
widget (5) self (screen (4,50,50,50,50,
<widget (3) (button(0,’PUSHME ’)) {
push(i) = do {
r e tu rn widget (2) (button(1,’PUSHED ’)) {
push(i) = do { r e tu rn push }
}
}
}.push (0) >)) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 42: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/42.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (5)
events ids command
1<-push(1) 0
1
2
3
4
5
widget (5) self (screen (4,50,50,50,50,
<do {
r e tu rn widget (2) (button(1,’PUSHED ’)) {
push(i) = do { r e tu rn push }
}>)) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 43: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/43.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (6)
events ids wait
1<-push(1) 0
1
2
3
4
5
widget (5) self (screen (4,50,50,50,50,
widget (2) (button(1,’PUSHED ’)) {
push(i) = do { r e tu rn push }
})) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 44: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/44.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (7)
events ids eval
0
1
2
3
4
5
widget (5) self (screen (4,50,50,50,50,
<widget (2) (button(1,’PUSHED ’)) {
push(i) = do { r e tu rn push }
}.push (1) >)) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 45: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/45.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (8)
events ids command
0
1
2
3
4
5
widget (5) self (screen (4,50,50,50,50,
<do { r e tu rn push }>)) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 46: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/46.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Toggle (9)
events ids wait
0
1
2
3
4
5
widget (5) self (screen (4,50,50,50,50,
widget (3) (button(0,’PUSHME ’)) {
push(i) = do {
r e tu rn widget (2) (button(1,’PUSHED ’)) {
push(i) = do { r e tu rn push }
}
}
})) {
move(x,y) = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 47: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/47.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
DiagramsWidget Calculus
Commands
Commands can:
Create widgets.
Create, access or update variables.
Read or write files and databases.
Access local context, e.g. orientation, battery charge, lightlevels.
Connect to servers.
Write to servers.
Send emails.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 48: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/48.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
Contents
1 CARA ApplicationsDefinitionsResearchCase Study
2 ModellingDiagramsWidget Calculus
3 Case Study Model
4 Other IssuesTypesImplementation
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 49: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/49.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
Main Screen
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 50: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/50.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
Add New Contacts
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 51: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/51.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
Notify
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 52: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/52.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
Execution
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 53: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/53.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
TypesImplementation
Contents
1 CARA ApplicationsDefinitionsResearchCase Study
2 ModellingDiagramsWidget Calculus
3 Case Study Model
4 Other IssuesTypesImplementation
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 54: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/54.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
TypesImplementation
Widget Types
Standard functional types:
Atoms int, str, bool
Functions α→ β
Lists [α]
Definitions type name = α
Extra types:
Widget Widget(α){x : β; . . .}Commands <α>
Events ∗
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 55: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/55.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
TypesImplementation
Simple Button (with types)
e x t e r n a l widget .Screen;e x t e r n a l widget .Button;
type Push = rec B.Widget(Button) { push:(int)-><B> }
type Main = rec M.Widget(Screen[<Push >]){ move:(int ,int)-><M> }
rec v a l main:<Main > =
f o l d [<Main >]widget self:Main (screen[<Push >](50,50,50,50, push)) {
move(x:int ,y:int):<Main > = do { r e tu rn self }
};
va l push:<Push > =
f o l d [<Push >]widget self:Push (button(’PUSHME ’)) {
push(i:int):<Push > = do { r e tu rn self }
}
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 56: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/56.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
TypesImplementation
Java
Java parser for language.
Java type-checker for Widget.
Java interpreter for Widget.
Swing-based external library.
Phone ’platform’ in Swing.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA
![Page 57: Model Driven Context Aware Reactive Applications · CARA Overview Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA. CARA Applications Modelling Case Study Model Other Issues](https://reader034.fdocuments.in/reader034/viewer/2022042810/5f9bb67a27b1491e711527aa/html5/thumbnails/57.jpg)
CARA ApplicationsModelling
Case Study ModelOther Issues
TypesImplementation
Next Steps
Implement the profile using standard UML tools.
Link CARA models and Widget calculus via modeltransformations.
More external libraries (Swing, HTML, Android).
Simplify types.
Tony Clark (with Dean Kramer and Samia Oussena, UWL) CARA