Instant Bidirectional QVT Transformation for Runtime Models
Runtime models Models that represent the structure, configuration, etc., of an executing system – Monitoring the system by reading the model – Reconfiguring the system by writing the model – With full semantics basis and supporting tools A hot topic in the models community – “A new trend” by Robert France’s survey on MDE – A in last MoDELS, a topic in this one
Supporting runtime models system Runtime system model System meta-model conforms to RFID readers, tags, sensors… Runtime application model Goods, storage… Runtime application model Persons, things, rooms… Different views according to different application concerns
Supporting runtime models system Runtime system model System meta-model conforms to Runtime application model Application meta-model relation conforms to Guided by Causal connection
Approach overview system Runtime system model System meta-model in MOF conforms to Runtime application model Application meta-model in MOF Relation in QVT-R conforms to Guided by Instant QVT transformation engine
Challenge Instant: – Traditional transformation is from model to model Inefficient when the models are big System changes are small but frequent – Require a new execution from change to change With live models maintained as a reference Bidirectional: – Not bijective, one change may corresponds to many – Need a proper and determined semantics
Illustration
Batching transformation sr : SysRoot name : pkusi ar : AppRoot name = pkusi rm : Room number = 1621 temp = 16.0 ps : Person name = Hui id = 102 th : Thing name=phone id = 104 root roompersonthing own ownerperson locate sn : Sensor id = 1621 temp=16.0 Bright=620.0 rd : Reader id = 1621 tg1 : Tag id = 102 root reader sensor tag reader add:[rd, reader, tg2] tg2 : Tag id = 104 Why in-efficient: the impact of the change is not the whole model, but since the change is not considered, the impact scope is not utilized
Instant transformation sr : SysRoot name : pkusi ar : AppRoot name = pkusi rm : Room number = 1621 temp = 16.0 ps : Person name = Hui id = 102 th : Thing name=phone id = 104 root roompersonthing own ownerperson locate sn : Sensor id = 1621 temp=16.0 Bright=620.0 rd : Reader id = 1621 tg1 : Tag id = 102 root reader sensor tag reader add:[rd, reader, tg2] tg2 : Tag id = 104 set:[th, locate, rm]
About bidirectional sr : SysRoot name : pkusi ar : AppRoot name = pkusi rm : Room number = 1621 temp = 16.0 ps : Person name = Hui id = 102 th : Thing name=phone id = 104 root roompersonthing own ownerperson locate sn : Sensor id = 1621 temp=16.0 Bright=620.0 rd : Reader id = 1621 tg1 : Tag id = 102 root reader sensor tag reader tg2 : Tag id = 104 remove:[rd, reader, tg2] set:[th, locate, null] destroy:[th]
Contributions of this paper Formal semantics of instant QVT transformation for runtime models Algorithms to implement instant QVT transformation An instant transformation engine based on mediniQVT
Formal semantics Abstraction: Properties – Consistency: – Stability: – Restorability:
The algorithm Basic idea – Record the mapped model elements(traces) – Analyze the impact of the change Influence no relations: stop Influence a relation: – Found the relevant traces, re-evaluate Cause new groups of elements to be mapped – Create new traces, record changes Cause an existing trace to fail – Delete the trace, roll-back the recorded changes
Detailed Algorithm
Evaluation Feasibility and effectiveness Performance Limitation
feasibility and effectiveness Main case study: Our SmartLab IOT system – System meta-model: rfid readers, tags, sensors, switches, locks – Application meta-model: rooms, persons, things Scenarios: – Missing personal effects – Leaving the air-conditioner on – … Conforms to the expectations of scenario developers Other case studies: JOnAS-C2, JOnAS-Client/Server
performance Made-up models conforming to IOT case – Control the scale – Eliminate other factors such as device invocations
Limitation For modeling – Every model element must has a key attribute – Only support unordered multiple properties For QVT – No “where” clause (but can use when)
Related work Runtime models – Usually based on code wrapping – One on TGG, but no discussion about runtime-model specific semantics Model transformation with semantics – On batching transformations Incremental transformation (supported by QVT) – Still model to model, not change to change Instant transformation – No transformation language, or TGG
Conclusion Runtime models and causal connections A transformation-based approach to support causal connections – Instant, bidirectional Semantics Algorithms Implementation and evaluation
Thank you for your attention