Diagram Interchange Proposal Maged Elaasar, IBM melaasar@ca.ibm.com
Proposed Diagram Interchange (DI) Diagram Interchange (DI) (replaces current DI) Provides an abstract metamodel that defines diagram interchange syntax Domains extend DI using inheritance to define domain specific DI Diagrams are interchanged as instances of the domain-specific DI MOF M3 spec DI M2 spec DSL DSL DI Model Diagram M1 user Abstract Syntax Diagram Syntax Is Instance of Inherits References
DI Metamodel - View Hierarchy Connector is owned by the lowest common parent of the source and target view (constraint) Connector’s source and target associations are uni-directional Waypoints are ordered and non unique
DI Metamodel – Style Sheet StyleRules are ordered MasterSheets are many and ordered StyleRule does not need explicit ‘type:Class’ association, since can be infered from ‘property.type’
UML Class Shape Example Diagram width x y Node height ratio Node showTitle collapsed visible ratio Node showTitle collapsed visible <Diagram xmi:id="1"> <definitions mxi:type="dd:DiagramDefinition" href="uml.definition#//ClassDiagram"/> <children mxi:id="2"> <definitions mxi:type="dd:NodeDefinition" href="uml.definition#//Class"/> <element xmi:type="uml:Class" href="model.uml#//..."/> <children xmi:id="3"> <definitions mxi:type="dd:NodeDefinition" href="uml.definition#//AttributeCompartment"/> <styles key="collapsed" value="true"/> <styles key="ratio" value=".25"/> </children> <children xmi:id="4"> <definitions mxi:type="dd:NodeDefinition" href="uml.definition#//OperationCompartment"/> <styles key="showTitle" value="true"/> <styles key="ratio" value=".75"/> <sourceConnectors href="8"/> <styles key="x" value="100"/> <styles key="y" value="200"/> <styles key="fillColor" value="0x00FF000000"/> <children mxi:id="5"> <children xmi:id="6"> <children xmi:id="7"> <targetConnectors href="8"/> <styles key="x" value="300"/> <connectors mxi:id="8"> <definitions mxi:type="dd:ConnectorDefinition" href="uml.definition#//Generlization"/> <element xmi:type="uml:Generalization" href="model.uml#//..."/> <source xmi:type="di:Node" href="2"/> <target xmi:type="di:Node" href="5"/> <bendpoints x="50" y="10"/> <bendpoints x="100" y="200"/> <styles key="lineColor" value="0x0000FF0000"/> </connectors> </Diagram>
UML Association and Interface Realization Connector Node Node offset offset Node offset Node Node offset offset Connector
UML DI Metamodel – View Hierarchy Two subtypes of Compartment for UML : List Compartment and Diagram comparemtment Diagram’s umlShape and umlConnector are derived unions subsetting child and connector, respectively How do we make the Diagram.child collection ordered (needed for z-order)?
UML DI Metamodel – Common Views
UML DI Metamodel – Class Diagram
UML DI Metamodel – Class Diagram Shapes
UML DI Metamodel – Class Diagram Connectors
DI More Abstractions Try to have a crack at it but it is not critical (not show stopper) Could define them as concrete to allow creating adhoc diagrams Define common properties as mixin types in separate DI packages
DI Extensibility Profiles Allow subsetting, redefinition of base properties in stereotypes Clarify what types other than stereotypes are allowed in profiles and what it means What DD needs to do to get access to profiles (package merge?)
Proposed Diagram Graphics Diagram Graphics (DG) Provides an abstract metamodel that defines diagram graphics syntax Provides a way to map the abstract syntax (DSL+DI) to the graphical syntax (DG) Domains extend DG to create domain specific DG and its mapping from their DSL+DI DI DG Mapping DG Graphics DSL Model (abstract syntax) Controller (mapping) View (concrete syntax)
Proposed Diagram Definition Architecture Diagram Graphics (DG) Provides an abstract metamodel that defines diagram graphics syntax and how it maps to the abstract syntax (DSL+DI) Domains extend DG to create domain specific DG metamodel MOF M3 spec DI DG M2 spec DSL DSL DI DSL DG Rendered Graphics Model Diagram M1 user Is Instance of Abstract Syntax Diagram Syntax Diagram Graphics Inherits References Uses
Diagram Graphics (DG) – Declarative Graphics Class Diagram Figure width x y Classifier Figure [*] Node Stereotype Label Figure [1] height Name Label Figure [1] ratio Node showTitle collapsed visible Package Label Figure [1] Attribute Compartment Figure [1] Title Label Figure [1] ratio Node List Container Figure [1] showTitle collapsed visible Label Figure [*] Operation Compartment Figure [1] Title Label Figure [1] List Container Figure [1] Label Figure [*]
Diagram Graphics (DG) – Declarative Map Model (abstract syntax) Controller (map) View (concrete syntax)