160 likes | 247 Views
UMLX : A Graphical Transformation Language for MDA. E.D.Willink, EdWillink@iee.org GMT Consortium, www.eclipse.org/gmt (Thales Research and Technology (UK) Limited, Reading, England) 2nd Generative Techniques in the Context of the Model Driven Architecture Workshop OOPSLA’2003, Anaheim
E N D
UMLX : A Graphical Transformation Language for MDA E.D.Willink, EdWillink@iee.org GMT Consortium, www.eclipse.org/gmt (Thales Research and Technology (UK) Limited, Reading, England) 2nd Generative Techniques in the Context of the Model Driven Architecture Workshop OOPSLA’2003, Anaheim 26 October 2003
Overview • UML and QVT perspective • Use UMLX in less obvious ways • workshop paper shows use as a programming language • Not UMLX Concrete Graphical Syntax • see the workshop paper • Transformation as a Composable Component • Summary
Transformation in Program Context • Start state comprises the input model(s) • End state comprises the output model(s) • For QVT: • Transformation hierarchy is the full program • More generally: • Transformation is a more powerful form of state transition
Transformation Syntaxes • 1 Abstract Transformation Syntax (QVT) • 1+ Concrete Textual Syntax • 1+ Concrete Graphical Syntax • Transformations • to QVT (extract information content) • between formats via XMI or XMID
MDA Models • Platform Independent Model • specification of what needs to be done • too abstract for implementation • Platform (Description) Model • physical, virtual, intellectual resourcesavailable to implement solution • Platform Specific Model • a particular implementation • Mark Model • PIM + PDM specific configuration
MDA Meta-Models • Every Model is an instance of some Meta-Model • traditionally the meta-model has been undefined but implicit • with MDA we model it
Transform as a Model • Transform may also be a model • traditionally just Java code • but even Java code is an instance of the Java meta-model • Closed perspective - frozen executable • Open perspective - generic engine, re-usable model
Transform between Meta-Models • Every model instantiates a meta-model • Transformation meta-model reuses input/output meta-model • UMLX extends UML for transformations
Transformation • From LHS • read-only • shared • To RHS • write-only • shared • non-conflicting • In-place if LHS and RHS are same model instance • Define LHS meta-model • Define RHS meta-model • Define transformations between meta-model instances • (and pivot models if complex)
Match order • Select search order - {a1,a2}, {b1,b2,b3}, {c1,c2}, d, [e*, [f*, [g]]] 'loop hoisting'
Schema driven matching • Branch and bound search • Advance one node/free variable per level • pick narrowest relationship to advance to next node • composition > association • forward > backward • unity multiplicity > multiple • validate advance • type • back relationships • constraints • nested transformations • Smarter heuristics can lookahead
Composition • Re-usable black boxes • Encapsulation • internal data • internal behaviour • Defined Interface • external data • external behaviour • Meta-Models define what the external data comprises • Ports define where the external data flows
Scheduling/Synchronisation • ‘Data’ flow defines when transformation occurs • when the input models exist, then output gets created • Evolution identities (and {ordered} sets) define how • multiple concurrent match results are combined • multiple concurrent transform results are combined • Shared, read-only LHS • Shared, non-conflicting write-only RHS • Declarative, with causal constraints
Re-usability • The UML to RDBMS example • http://dev.eclipse.org/viewcvs/indextech.cgi/gmt-home/doc/umlx/M4M03.pdf?rev=HEAD • 11 transforms in UMLX • multiple transforms/steps/rules/helpers in other approaches • UMLX transform unifies concepts • Rule/Step is a transform with inputs/outputs bound • steps may be factored out as (sub-)transformations • Helper is a transform with inputs bound • predicates may be factored out as (sub-)transformations • Graphics scalability problems soluble • factoring out sub-transformations with good clear names • use of embedded OCL
UMLX Support • UMLX editor configured within GME • by defining a UMLX editing meta-model • UMLX compiler designed in UMLX • over 200 diagrams so far • UMLX execution engine designed in UMLX • over 100 diagrams so far • Bootstrap by manual transliteration to NiceXSL • human-friendly form of XSLT • Prototype generates XSLT code • currently for concurrent and sequential transforms on classes • ==> Fast, configurable, custom compiler-compiler
Summary • UMLX is a natural extension of UML • opportunities for more elaborate/useful syntaxes • UMLX exhibits good composition properties • declarative transform sequencing • can degenerate to imperative • declarative transform concurrency • can be {ordered} • arbitrary OCL at innermost level • influence the QVT abstract syntax • UMLX tools progressing