190 likes | 354 Views
Diagram Definition: an Overview Third OMG/Eclipse Symposium 25 March 2012 Maged Elaasar, melaasar@ca.ibm.com Senior Software Engineer IBM Rational Modelling Tools. Outline. The Need for Diagram Definition Existing Diagram Definition Approaches Diagram Definition Specification
E N D
Diagram Definition: an Overview Third OMG/Eclipse Symposium25 March 2012 Maged Elaasar, melaasar@ca.ibm.com Senior Software Engineer IBM Rational Modelling Tools
Outline • The Need for Diagram Definition • Existing Diagram Definition Approaches • Diagram Definition Specification • UML Class Diagram Definition Case Study • Interchanging an Example Class Diagram • Future Work
The Need for Diagram Definition • Graphical modeling languages are defined with their: • Abstract syntax: formally using MOF • Concrete graphical syntax: informally using text and (example) figures • Formal diagram definition is needed • Enables interchange of modeling diagrams among tools • Enables consistent rendering of diagrams by tools • Enables consistent interpretation of diagrams by users
Diagram Definition (DD) Specification • DD defines two standard metamodels • Diagram Interchange (DI): enables defining the diagram interchange syntax • Diagram Graphics (DG): enables defining the concrete graphical syntax
Diagram Definition Architecture MOF Mapping Language MOF M3 spec Abstract Syntax Diagram Syntax Concrete Syntax DI M2 spec CS Mapping Specification AS AS DI DG Model Diagram Graphics M1 user CS Mapping Model (interchanged) Controller (executed) View (rendered) Instantiates Specializes References DD Spec Language Spec DI : Diagram Interchange DG: Diagram Graphics AS: Abstract Syntax CS : Concrete Syntax
Diagram Interchange (DI) • Defines diagram interchange syntax (what users can control) • Examples: diagram layout, appearance options, notational options • Provides basic primitives that can be extended for each language
Diagram Graphics (DG) • Defines concrete graphical syntax (what language specifications control) • Examples: shape and line notations for each abstract syntax element • Provides extensive 2D graphics primitives (similar to SVG)
UML Class Diagram Definition: an Example • We validated the DD architecture on UML DI M2 UML CS Mapping UML UML DI DG • We used a subset of the UML class diagram • Three classifiers: Class, Interface and Datatype • Three relations: Association, Generalization and InterfaceRealization
UML Diagram Interchange • Metamodel design principles: • Avoid interchanging redundant info with the referenced model • Avoid interchanging purely stylistic info (e.g., colors) • Interchange simple layout info (bounds / waypoints relative to diagram) • Interchange overlapping order (using ordered collections) • Keep the inheritance hierarchy small (mixed bags of optional properties)
UML Concrete Syntax MappingUML DI Elements to Graphics Map all diagram to graphics Map all diagram elements to graphics Map a shape to a group {a graphic, labels and compartments} Map an edge to a group {a poly line and labels} Map a compartment to a group {rectangle and nested elements} Map a label to a text with appropriate string
UML Concrete Syntax Mapping: UML Elements to Strings Define signature of an element Define signature of an interface Define signature of a property
UML Concrete Syntax Mapping:UML Element to Graphics Map a class a rectangle Map an interface to a rectangle Map an interface to a circle Define an interface realization line style Define an interface realization line marker Map an interface realization to a poly line
Diagram Definition Export Testing Architecture What tools provide today Model Export UML Model Concrete Syntax Mapping DG Model Rendering To Graphics SVG Image Diagram Export UML DI Model Tool-Specific Format Standard Format M2T Transformation RSA Tool M2M Transformation M2M Transformation M2M Transformation
Interchanging an Example Class Diagram: an Experiment RSA Diagram Exported Diagram
Limitations and Future Works • normative mapping from DG to SVG (needed to bootstrap DD) • Graphical mapping language (Graphical BNF) • Full UML DD (UML DI as a first step)
Conclusion • Diagram definition is needed for consistent interchange and interpretation • Diagram definition (DD) v1.0 is a new specification to address this need. • We validated DD with an example involving a subset of UML class diagram • Defined UML DI metamodel • Defined a mapping from UML DI metamodel to DG metamodel • Defined a tool architecture for testing DD (export) • Carried an experiment for interchanging an example class diagram successfully
More Information • Elaasar, M; Labiche, Y.: Diagram Definition: a Case Study with the UML Class Diagram. MoDELS'11, LNCS, vol. 6981, pp. 364-378, 2011. http://www.springerlink.com/content/y7h4820238438014/
Thank You Questions? Maged Elaasar, melaasar@ca.ibm.com