Query-Driven Incremental Synchronization of View Models

11
Budapest University of Technology and Economics Department of Measurement and Information Query-driven incremental synchronization of view models Csaba Debreceni, Ákos Horváth, Ábel Hegedüs, Zoltán Ujhelyi, István Ráth and Dániel Varró ([email protected])

description

Views are key concepts of domain-specific modeling in order to provide specific focus of the designers by abstracting from unnecessary details of the underlying abstract model. Usually, these views are represented as models themselves (view models), computed from the source model. However, the efficient maintenance of views when the source model changes is challenging, as recalculation from scratch has to be avoided to achieve scalability. In the talk, we propose an approach to define view models in a highly automated way, based on declarative model queries. The views are automatically populated in accordance with the lifecycle of regular model elements - however, their existence is entirely bound to the underlying abstract model. This means that view models are automatically and incrementally maintained. Our contribution can also be interpreted as extending the concepts of derived features to derived objects, specified and maintained by incremental queries.

Transcript of Query-Driven Incremental Synchronization of View Models

Page 1: Query-Driven Incremental Synchronization of View Models

Budapest University of Technology and EconomicsDepartment of Measurement and Information Systems

Query-driven incremental synchronization of view models

Csaba Debreceni, Ákos Horváth, Ábel Hegedüs, Zoltán Ujhelyi, István Ráth and

Dániel Varró ([email protected])

Page 2: Query-Driven Incremental Synchronization of View Models

Motivating project Avionics research project

oModel-driven toolchaino Allocate SWs onto HWso Platform: ARINC 653

Functional Architecture

Platform description

Component database

Allocation

Integrated System Model

Page 3: Query-Driven Incremental Synchronization of View Models

3

Motivating scenario Avionics research project

oModel-driven toolchaino Allocate SWs onto HWs

Simplified Example

FAM_PilotControl : Function

FAM_Navigation : Function

FAM_FMS : Function

FAM_EMS : Function

nav2ems:InformationLink

provider

consumer

subFunctions

provider

consumer

PilotControl

SubS1

Navigation

FMS

SubS2

EMS

tag: func

tag: func

tag: func

tag: func

EMS: Engine Management System FMS: Flight Management SystemInPort/OutPort

nav2fms:InformationLink

Simulink FAM

Id

Id Other SubSystem without tag

Function SubSystem with "func" tag)

Port Blocks

id:Function id:InformationLink

View

Maintanence• Incrementally• Immediately

Maintenance:• Incrementally• Immediately

Page 4: Query-Driven Incremental Synchronization of View Models

4

Underlying technology: EMF-IncQuery EMF-IncQuery

o Incremental model query engineo Pattern language with annotations

Query Model

Updated results Result deltas

Evaluator

Model change

Efficient change propagation

Always up-to-date results without model re-traversal

Track changes of your model in terms of queries

Page 5: Query-Driven Incremental Synchronization of View Models

Definition of view models Derivation rules

o Graph patterns with annotations• Precondition: a pattern match• Execution rule: defined in annotations

o Query Based Object / Feature

5

function(ss)

@TraceLookup(src = ss, trg = f)

@QBO(eClass = Function)

@QBF(src = f, trg = id, f = id)functionIdentifier(ss, id)

@TraceLookup(src = ssys, trg = s)

@QBF(src = p, trg = s, f =subFunctions)

subFunction(psys, ssys)

function(psys)

B:psys B:ssys

function(ssys)

...subBlock+

@TraceLookup(src = psys, trg = p)

Page 6: Query-Driven Incremental Synchronization of View Models

More matches can appear at the same timeo Ordered execution schema (priority for rules)

Internal traceability for created objectso Explicit definition

Execution of motivating example

11

FAM_PilotControl : Function

FAM_Navigation : Function

FAM_FMS : Function

subFunctions

consumer

PilotControl

SubS1

Navigation

FMS

tag: func

tag: func

tag: func

Simulink FAM

subFunctions

Query results Traceability

functionf_1

f_2

f_3

Trace

Trace

Trace

a 2 3appear create add

Query results

functionIdentifierf_1 i_1

f_2 i_2

f_3 i_3

subFunctionf_1 i_1

f_2 i_2

b appear 4 set

Page 7: Query-Driven Incremental Synchronization of View Models

Viewers related annotations Special annotations

o Uses a specific target metamodel (notation)o Simplifies the tracing of (notation) model elementso Enables faster implementation on user side

7

item(func)

@TraceLookup(src = s, trg = sub)

@Item(label = "$func.id")

@ContainsItem(src = par, trg = sub)

containment(p, s)

@TraceLookup(src = c, trg = consumer)

@Edge(src = provider, trg = consumer)

subFunction(p, c) @TraceLookup(src = p, trg = provider)

@TraceLookup(src = p, trg = par)

Page 8: Query-Driven Incremental Synchronization of View Models

Chaining of view models

FAM_PilotControl : Function

FAM_Navigation : Function

FAM_FMS : Function

provider

subFunctions

consumer

nav2fms:InformationLink

FAM

subFunctions

Traceability

Trace

Trace

Trace

Query results

item

edgec_1p_1

containmentp_1 s_1

p_2 s_2

f_1

f_2

f_3

Notation

Item

Item

Item

Containment

Contaimnent

Edge

Trace

Trace

Trace

target

sourcetarget

source

target

source

1 2 3appear create add

Source model Target model

Traceability model

View model

…QBO QBF

Target metamodel

View model

RenderModule

QBO: Query Based ObjectQBF: Query Based Feature

Zest

JFace

yFiles

Page 9: Query-Driven Incremental Synchronization of View Models

9

Updating view models Initial setup of derivation rules

o EClassifiers, EStructuralFeatures Query result deltas

o Delta = (Found, Lost) Intergration architecture

Source model

Derivation rules

Query engine

View synchronization View model

Change notifications Match set delta

Application

Model manipulation ConfigurationModel manipulation

1

23

4

Page 10: Query-Driven Incremental Synchronization of View Models

10

TrainBechmarko 6 different size exampleso Source: 6.000 – 180.000 | View models: 150 – 4.500oWide variety of patterns such as transitive closure

Evaluation

Page 11: Query-Driven Incremental Synchronization of View Models

11

Summary and Future work Summary

o Deriving and synchronizing view models• Incrementally and live• Derivation rules

– Annotation over graph queries– Explicit tracing mechanism

Future planso Extending domain specific language• Life-cycle management capabilities

o Kleisli category based model transformationso Integration with Sirius framework (ongoing)