An ATL Example Bridging UML profiles and Domain

An ATL Example Bridging UML profiles and Domain Specific Languages • Two major approaches appears in Model Engineering: • UML approach : It uses profiles to model domain specific • concepts. Approach based on DSL (Domain Specific Languages): It aims at representing every domain with a specific metamodel. • We need interoperability between these approaches: • A tool which can perform automatic transformations between UML models defined using a profile for a metamodel and models conforming to this metamodel. © 2005 ATLAS Nantes

An ATL Example The tool MOF UML MMa Ma THE TOOL Ma. uml* * Uses UML Profile for MMa © 2005 ATLAS Nantes

An ATL Example UML Profiles (1/2) • UML profiles are dedicated to the strategic intention to formalize and support the development of applications with UML : • • • It allows designers to customize UML to their particular domain or purpose. It defines virtual UML subclasses by associating stereotypes, tag definitions and constraints to provide an additional meaning to UML classes. Profiles are generally represented by mapping tables which show maps between profiled Meta. Model elementets and UML ones. Mapping table Meta. Model Element UML Element Meta. Model_Class The UML class and eventualy stereotypes which represent the Meta. Model_Class 3 © 2005 ATLAS Nantes

An ATL Example UML Profiles (2/2) • • Each element of the profile maps to a specific Meta. Model element The mapping table is completed by mapping details: • • They define more precisely each map between UML and MOF elements. Each mapping details contains subsections covering these topics: tags, mapping properties, constraints, and limitations. Tags are used for MOF properties not directly supported by UML. Some MOF details cannot be rendered in UML using this profile. Those details are described by limitations. Tags Tag Value Feature Map MOF Feature UML Model Constraints Limitations © 2005 ATLAS Nantes

An ATL Example UML Profile For MOF (1/2) • • Each element of the profile maps to a specific MOF element. Table below show some mapping element. UML Profile For MOF : mapping table Meta. Model Element UML Element Package Model or Package, both with <<metamodel>> stereotype Association Exception or Class with <<exception>> stereotype Constant Data. Value Constraint Import Dependency with <<import>> or <<clustering>> stereotype Primitive. Type Data. Type Reference Attribute with <<reference>> stereotype or Association. End (if implicit. References is set to true) © 2005 ATLAS Nantes

An ATL Example UML Profile For MOF (2/2) Tags • • Each element of the profile maps to a specific MOF element as shown in the mapping table above. The mapping table is completed by mapping details. Tag Value org. omg. uml 2 mof. has. Implicit. Re ferences true (default) or false Feature Map MOF Feature UML container namespace or null if the namespace is either null or not mapped to a MOF Package contents owned. Element, tagged. Value is. Root is. Leaf is. Abstract visibility always set to public_vis supertypes other packages on supplier end of UML dependencies stereotyped as <<subtyping>> that binds them to this package. UML Model Constraints UML Model/Package representing a nested MOF Package must not have a tag org. omg. uml 2 mof. has. Implicit. References. Limitations The order of elements is not fully preserved when rendered using the profile as UML since it has separate associations for owned. Element and tagged. Value. 6 © 2005 ATLAS Nantes

An ATL Example UML Profile for Data Modeling (1/2) • • Stereotypes for Various Persistent Storage Mechanisms Stereotype Storage Mechanism Type <<File>> File <<Hierarchical Database>> Hierarchical database <<Object-Oriented Database>> Object-oriented database (OODB) <<Object-Relational Database>> Object-relational database (ORDB) <<Network Database>> Network database <<Relational Database>> Relational database (RDB) <<XML Database>> XML database Example of physical data model for a relational database using the profile 7 © 2005 ATLAS Nantes

An ATL Example UML Profile for Data Modeling (2/2) Stereotypes for Classes Stereotype Diagram. Type Core Notation Application Style Issues <<Associative Table>> Physical Yes Apply this to associative tables in a PDM for a relational database. <<Entity>> Logical, Conceptual No Optional notation that is implied by the model type. <<Index>> Physical No Apply this when you are modeling an index that implements a table key within a relational database. Doing so indicates a dependency from the index to the table or to the key column(s) that the index implements. The stereotypes for LDMs and conceptual DMs on a diagram implies that all class boxes on the diagram are entities unless otherwise marked. Indices are implied by keys, so you might not want to invest the time to model the index in the first place. <<Lookup Table>> Physical No Apply to tables that are used to store simple "lookup" lists. Just because you are using a table for lookup values does not imply that everyone uses it that way. Therefore you may not wish to mark the table with this stereotype as it may confuse people. <<Stored Procedures>> Physical Yes Apply this to a class that contains only the operation signatures for the stored procedures of the database. <<Table>> Physical No Optional notation that is implied by the model type. <<View>> Physical Yes Apply this when you are modeling a view to a table. Indicate a dependency to each table involved in the definition of the view. 8 The stereotype for PDMs on a diagram implies that all class boxes on the diagram are tables unless otherwise marked. © 2005 ATLAS Nantes

An ATL Example The tool configuration (1/3) MOF MMa Ma MMWeaver Profile. Meta MWeaver Profile. For. MMa Ma. uml* T 1 Atl * Uses UML Profile for MMa UML weaving conforming transformation © 2005 ATLAS Nantes

An ATL Example The tool configuration(2/3) MOF MMa Ma MMWeaver Profile. Meta MWeaver Profile. For. MMa Ma. uml* T 2 Atl * Uses UML Profile for MMa UML weaving conforming transformation © 2005 ATLAS Nantes

An ATL Example The tool configuration(3/3) Muml MMM TMMto. UML MMA TAMWto. ATL MAMW Mprofile TUMLto. MM Muml = TAMWto. ATL ( MMM , Mprofile ) =TUMLto. MM( MMM ) TUMLto. MM = TAMWto. ATL (MMA , MAMW , Mprofile ) © 2005 ATLAS Nantes

An ATL Example Profile Meta. Model • • • The definition of each virtual UML subclass which corresponds to a definition of a Profile element (in particular a class of the metamodel profiled) can be done in several ways. An UML element can take more than one stereotype to define the same element of the metamodel profiled. However, it can also take different stereotypes to define different elements. We should have the possibility to navigate the UML elements used by the Profile and have access to some of their attributes and values Profile Meta. Model 12 © 2005 ATLAS Nantes

An ATL Example The Profile. For. MOF Model • profile Profile. For. MOF : MOF { Tag Value documentation any string …… MOF Feature define Association. End { UML!Association. End { name tag documentation ; -- Association. End. annotation } nested{ ref name; container ref namespace; ref constraint; constraints ref participant; ref multiplicity {range { lower , upper } }; ref ordering : literal {ok_ordered (true) , ok_unordered(false)} ; UML Model. Element. name body of the first comment in Model. Element. comment; value of documentation tag Model. Element. namespace Model. Element. constraint -- is. Ordered is mapped to ordering (where true corresponds to ordered) ref ref } is. Unique : boolean = true; aggregation : literal {ak_composite , ak_aggregate , ak_none}; is. Navigable; changeability : literal {ck_changeagle (true), ck_frozen(false) , ck_add. Only(false)}; } …… } 13 © 2005 ATLAS Nantes

An ATL Example Using AMW for mapping details (1/4) • Five types of correspondences: • Link. Def • Link. Elem • Nested • If. Nested • New. Type © 2005 ATLAS Nantes

An ATL Example Using AMW for mapping details (2/4) • Example : MOF UML Association. End multiplicity lower range upper lower is. Ordered is. Unique : True <- ok_ordered False <- ok_unordered upper ordering : Ordering. Kind {ok_ordered , ok_unordered } © 2005 ATLAS Nantes

An ATL Example Using AMW for mapping details (3/4) • Example: Profile. For. MOF The Weaving Model Profile. Definition Alias. Type Link. Def Alias. Type Profile. Definition Association Link. Def Association Profile. Definition Association. End Link. Def Association. End Profile. Element Uml. Concept Association. End … EClass Multiplicity. Type EAttribute lower EAttribute upper EAttribute is. Ordered Link. Elem New. Type Tag. Definition is. Unique EAttribute is. Unique Nested Left lower Right lower Nested Left upper Right upper If. Nested. Reference multiplicity Node range Node lower Node upper Nested. Reference ordering Node ok_ordered Node ok_unordered Nested Left ok_ordered The Profile For MOF … EPackage Model Pro Model Nested Left ok_unordered left lower <left model> … EClass Association. End … EReference multiplicity … … The MOF Metamodel <right model> Right lower © 2005 ATLAS Nantes

An ATL Example Using AMW for mapping details (4/4) • Weaving model of the profile for MOF Tag Value documentation Any string alyas. For true or false MOF Feature UML name Model. Element. name container Model. Element. namespace constraints Model. Element. constraint 17 © 2005 ATLAS Nantes

An ATL Example Using ATL transformations • Two ATL transformations © 2005 ATLAS Nantes

An ATL Example Some Links • http: //www. jeckle. de/uml_spec. htm • http: //www 3. software. ibm. com/ibmdl/pub/software/ rational/web/whitepapers/2003/tp 185. pdf • http: //www. omg. org/mda/specs. htm#Profiles • http: //www. agiledata. org/essays/uml. Data. Modeling. Pr ofile. html • http: //mdr. netbeans. org/uml 2 mof/profile. html © 2005 ATLAS Nantes
- Slides: 19