MDD with OMG Standards MOF, OCL, QVT & Graph Transformations

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "MDD with OMG Standards MOF, OCL, QVT & Graph Transformations"

Transcription

1 1 MDD with OMG Standards MOF, OCL, QVT & Graph Transformations Andy Schürr Darmstadt University of Technology andy. 20th Feb. 2007, Trento

2 Outline of Presentation 2 Languages and Tools for Model-Driven Development OMG s Model Driven Architecture (MDA) Model-Driven Software Development (MDD) MDD requirements derived from industrial case study From MDD to the World of Graph Transformations Comparison of Meta-Case, Model/Graph Transformation Tools MOFLON = OMG standards + graph transformation technology MOFLON architecture and sublanguages and Back Again Status quo and future of MOFLON Status quo of MDA/MDD/DSL/Meta-Case/ tools in general

3 3 Motivation

4 An Industrial Case Study 4 Magnetic Resonance Imaging System Real-Time Safety-Critical 3D volume scan Quickly evolving technology Scan speed Image resolution More clinical applications Motionless tissues [ ] Heart surgery MLOC, 3 computers, 80 processes SW developers (engineers, scientists)

5 Source code organization 5 source code files leaves of a building block hierarchy

6 Domain-Specific Architecture Concepts 6 A Building Block is a separated unit of Ownership and Responsibility Software Architect for the System Senior Designer for a Subsystem Product-related documents Requirements Specification Design & Interface Specification Test Specification & Reports Functionally related code Encapsulation (information hiding) Hierarchy of Subblocks

7 Mapping of Building Blocks to UML 7

8 Different Levels of Abstraction 8 High-Level Architecture (Domain-Specific Language) Consistency? Low-Level Level Architecture (Unified Modeling Language) Consistency? Implementation (C-Code, Code, )

9 OMG s Model Driven Architecture 9 OMG often recommends: DSL 1 = DSL 2 = DSL 3 = UML Requirements describe describe CIM Transformation Transformation Transformation PIM CIM = Computer Independent Model PIM = Platform Independent Model PSM = Platform Specific Model DSL = Domain-Specific Language MOF = Meta Object Facility UML = Unified Modeling Language DSL DSL 1 Metamodel 1 Metamodel describe PSM DSL DSL 2 Metamodel 2 Metamodel describe Code describe DSL DSL 3 Metamodel 3 Metamodel System describe MOF

10 OMG s Model Driven Architecture 10 describes UML Metamodel describes MOF describes UML, MOF, describes PIM Model System M3 PSM M2 M1 M0 MOF Superstructure Infrastructure (Meta-)Modeling Layers Infrastructure = UML MOF

11 MDD/MDA Tool Requirements 11 Rapid Development (generating) of Local model analysis/transformation support Inter-model consistency checking Traceability link management support Bidirectional model update propagation Model import / export (code generators, parser, ) Tool wrappers for COTS tools New tools for domain-specific languages Integrated model version management

12 MDD Tool Chain 12 Text Templates Representation Grammar Meta Model Analysis Code- Fragment Results Modell Representation Code- Code Fragments Model Parser & Generator Code Parser & Generator High-Level ADL Objects Model Translator Low-Level ADL Objects Model Analyser Model Transformer Model Editor Model Constraints Model Transformations GUI Specification Model Translations Representation Grammar Text Templates Meta Model

13 Integrated Metamodeling Language 13 Code/Text Generator & Parser Parser GUI GUI (Concrete Syntax) Constraint (Static (StaticSemantics) Metamodel (Abstract Syntax) Transformation (Dyn. (Dyn. Semantics) Model-to-Model Translation

14 Categories of MDD Tools 14 Pure Model Transformation Tools AMMA / ATL (INRIA) ArcStyler (Interactive Objects Software GmbH) Pure DSL Editor Generators Microsoft DSL MetaEdit+ (MetaCase) Integrated Approaches GME (Vanderbilt University) (OMG Standards) MOFLON / Fujaba (Uni. Darmstadt, Paderborn, Kassel, )

15 Model Transformation with AMMA 15 Code Code Generator TCS GUI GUI (Concrete Syntax) Constraint (Static (StaticSemantics) Metamodel (Abstract Syntax) Transformation (Dyn. (Dyn. Semantics) ATL Model-to-Model Translation

16 The Microsoft DSL Tools 16 Code Code Generator Concrete Syntax Syntax (API) (API) Analysis Report Report Metamodel (API) (API) Transformation (API) (API) M2M M2M Translation

17 Microsoft DSL - Metamodellierung 17

18 Beispiel Editor Definition 18

19 The Meta-CASE Tool MetaEdit+ 19 Code Code Generator Concrete Syntax Syntax Analysis Report Report Metamodel (API) (API) Transformation (API) (API) M2M M2M Translation

20 Meta-Edit Edit+ + DSL Definition 20 Abstract Syntax Definition Concrete Representation Definition

21 The Meta-CASE Tool GME 21 Code Code Generator GUI GUI (Concrete Syntax) Constraint (Static (StaticSemantics) Metamodel (Abstract Syntax) Transformation (Dyn. (Dyn. Semantics) Model-to-Model Translation GReAT

22 GME + GReAT 22 Meta-Model Transformation Rule

23 Elements of OMG s MDA World 23 Model Model to to Text Text Transformation RFP RFP MOF MOF View Viewtoto Diagram RFP RFP OCL OCL Constraint MOF MOF Metamodel (QVT (QVT 1.0) 1.0) Transformation QVT QVT M2M M2M Translation

24 MDD / DSL Tools - Summary 24 OMG Languages AMMA (INRIA) MS DSL (Microsoft) GME (Vanderbilt) Fujaba (UPB, UKa) Metamodel Def. Lang. MOF KM3 + GME 5.0 UML 1.x GUI Def. Lang Constraint Def. Lang. Model Trafo Def. Lang. M2M Trans. Def. Lang. OCL ATL / OCL GME QVT 1 ATL - GReAT SDM QVT ATL / AMW 2 - GReAT 2 TGG - Code Gen. Def. Lang. - TCS + - Velocity 1: QVT has been designed for model-to-model translation purposes 2: ATL and GReAT are unidirectional model translation languages

25 Fujaba Goes to the OMG 25 Metamodel Def. Lang. Code Gen. Def. Lang. OMG Languages Fujaba (UPB, UKa) MOF UML 1.x GUI Def. Lang. -??? Constraint Def. Lang. Model Trafo Def. Lang. M2M Trans. Def. Lang. OCL - - SDM QVT TGG - Velocity

26 OMG Standard + Graph Transformation 26 Velocity, XSLT XSLT Codegenerierung DiaMeta Editorgenerierung University BW Munich University of Techn. Dresden OCL OCL Constraint MOF MOF Metamodel University of Techn. Darmstadt SDM SDM Fujaba Fujaba Graph Graph Transformations University of Paderborn University of Techn. Darmstadt TGG TGG (QVT (QVT Subset) M2M M2M Translation University of Kassel University of Paderborn

27 27 Back to the Running Example

28 Simplified Running Example 28 High-Level Architecture (Domain-Specific Language) Consistency Consistency Low-Level Level Architecture (Unified Modeling Language) Consistency Implementation - PSM (C-Code, Code, )

29 Forward Transformation Scenario 29 EBNF / XSLT Lang. Defs. MOF Meta Model Analysis Code- Fragment Results Modell Representation Code- Code Fragments Model Parser Code Generator High-Level ADL Objects Model Translator Low-Level ADL Objects Model Analyser OCL Constraints SDM Graph Transformation generates TGG (QVT-like) Translations Velocity / XSLT Templates MOF Meta Model

30 Meta-Modeling Modeling with MOF ADL DSL Meta-Model

31 Meta-Modeling Modeling with MOF Implementation Meta-Model contains association: heavy-weight association (implemented as relation) association owns association ends (and not class) association ends are not navigable (from classes)

32 Unique Features of MOF Different sorts of associations pointers versus real associations navigability (for API method selection) ownership of association ends (for DBMS schemata) Excellent support for model refinement class inheritance hierarchies refinement of associations (subset, redefines, ) refinement of packages Powerful modularization concepts hierarchies of packages import/export relationships merging of packages

33 Static Semantics of MOF From 90 MOF constraints are 48 (53%) 42 (47%) correct erroneous We added 86 constraints Reasons for 51 bug fixes are 50 (50%) additional 16 (29%) 51 (50%) modified 19 (34%) erroneous metamodel reference 21 (37%) erroneous semantics Erroneous syntax

34 Forward Transformation Scenario 34 MOF Meta Model Analysis Code- Results Fragment High-Level ADL Objects Low-Level ADL Objects Model Analyser OCL Constraints SDM Graph Query MOF Meta Model

35 Constraint Definition with OCL 2.x 35 Consistency rules for ADL A block uses interfaces that are required interfaces A block uses blocks that own required interfaces Equivalent OCL constraint (helper function) context Block def: illegalusage() : Boolean = self.usedconcept->forall( c ( c.ocliskindof( Interface ) implies requiredinterface->contains( c ) ) and ( c.ocliskindof( Block ) implies requiredinterface.owningblock->contains( c ) ) )

36 Constraint Definition with Graph Query 36

37 Forward Transformation Scenario 37 MOF Meta Model Analysis Code- Fragment Results High-Level ADL Objects Model Translator Low-Level ADL Objects Model Analyser OCL Constraints SDM Graph Query SDM Graph Transformation MOF Meta Model

38 Forward Transformation - Context 38 source model traceability link target model

39 Forward Transformation - Complete 39 Created target model extension (plus new traceability link)

40 Generating Operational Rules 40 Needed model transformation rule sets: forward transformation backward transformation create traceability links only check traceability link consistency forward/backward attribute propagation remove traceability links forward/backward deletion propagation Generate all transformation rule sets from single declarative bidirectional model integration rules QVT core/relational = Triple Graph Grammars (TGG)

41 Forward Transformation Scenario 41 MOF Meta Model Analysis Code- Fragment Results High-Level ADL Objects Model Translator Low-Level ADL Objects Model Analyser OCL Constraints SDM Graph Query SDM Graph Transformation generates TGG (QVT-like) Translations MOF Meta Model

42 TGG (QVT( QVT-like) Specification 42 Declaration of Traceability Relationships (Mappings) with associated bidirectional translation rules

43 TGG (QVT( QVT-like) Rule for Blocks 43 Architecture model File system model

44 TGG (QVT( QVT-like) Rule for Subblocks 44 Architecture model Inherited rule pattern File system model

45 Generated Forward Transformation 45

46 Summary of MOFLON MDD World 46 Text Templates EBNF / XML Lang. Defs. MOF Meta Model Analysis Code- Fragment Results Modell Representation Code- Code Fragments Model Parser & Generator Code Parser & Generator High-Level ADL Objects Model Translator Low-Level ADL Objects Model Analyser Model Transformer Model Editor OCL Constraints SDM Graph Transformation DiaMeta Ed. Specification TGG (QVT-like) Translations Representation Grammar Velocity / XSLT Templates MOF Meta Model

47 47 Conclusions

48 and Back Again to MDD 48 Model-Driven Development (MDD) is a hot topic of the Software Engineering Community with all the resulting pros and cons MDD combines established technology meta-modeling / meta-case tool technology compiler compiler technology Currently available (commercial / academic) MDD tools support only subsets of all MDD activities lack precise definition (available for graph transformations)

49 OMG Standard + Graph Transformation 49 Velocity, XSLT XSLT Codegenerierung DiaMeta Editorgenerierung University BW Munich University of Technology Dresden OCL OCL Constraint MOF MOF Metamodel University of Technoloy Darmstadt SDM SDM Fujaba Fujaba Graph Graph Transformations University of Paderborn University of Technology Darmstadt TGG TGG (QVT (QVT Subset) M2M M2M Translation University of Kassel University of Paderborn

50 Typical MOFLON Applications 50 system engineering tool integration (ToolNet project with DaimlerChrysler et al.) model analysis / design guideline checking (MATE project with DaimlerChrysler et al.) software analysis / reverse engineering (based on experiences at Philips Medical Research) visual DSL editor development (ECLIPSE plug-ins in cooperation with UniBw)

51 Open Problems & Ongoing Work 51 Metamodeling with MOF 2.0 missing UML concepts (association classes) integration with UML profile definition Constraint Definition with OCL 2.0 incremental (event-driven) constraint checking integration with transactions & repair actions Local Model Transformations with SDM handling of composition hierarchies (still a problem!) integrated formal definition of language mix Model To Model Transformations with TGGs merging TGGs with QVT Relational Integration with Editor Generator Framework DIAMETA

52 52 Model-Driven Development with OMG Standards Graph Transformations Version 1.0 (Queen) Questions? Download/Feedback: