1 / 14

On Using UML Profiles in ATL Transformations

On Using UML Profiles in ATL Transformations. Manuel Wimmer and Martina Seidl . 1st International Workshop on Model Transformation with ATL . Manuel Wimmer. This work has been partly funded by the Austrian Science Fund (FWF) under grant P21374-N13. Introduction.

jason
Télécharger la présentation

On Using UML Profiles in ATL Transformations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. On Using UML Profiles in ATL Transformations Manuel Wimmer and Martina Seidl 1st International Workshop on Model Transformation with ATL Manuel Wimmer Thisworkhasbeenpartlyfundedbythe Austrian Science Fund (FWF) undergrant P21374-N13.

  2. Introduction • Modeling languages are defined with • metamodels • UML profiles • Model transformation approaches support • metamodelsas first classlanguage definitions • but not UML profiles • UML profiles are frequently used in practical transformations • vertical: PIM -> PSM -> Code • horizontal: Integration of DSMLs and UML

  3. Motivation AllFusionGen 2 Rational Software Modeler (back in 2006) Goal of the ModelCVS project: Bridge AllFusion Gen (AFG) with UML tools AFG consists of several DSLs: Data Model, GUI Design, Dialog Flow, … Case Study: Bridge Data Model with UML Class Model Integration architecture More information: http://www.modelcvs.org

  4. RunningExample Metamodel Excerpt: AFG::EntityType 2 UML::Class AFG::DataModel UML C EntityType noInstances: Bool avgOccurrence:Int minOccurrence:Int maxOccurence:Int Class isAbstract:Bool C AnalysisEntityType DesignEntityType phase : String store : String «profile» AFG «metaclass» Class «stereotype» EntityType avgOccurrence:Int minOccurrence:Int maxOccurrence:Int «stereotype» AnalysisEntityType «stereotype» DesignEntityType phase :String store : String

  5. Profile Support in ATL Transformation ExecutionConfiguration Profile is additional input model Usageofexternal UML 2 API AFG 2 UML AFG MM UML MM AFG Profile AFG Model Execute ATL Transformation UML Model Input Output AFG Profile UML API UML MM

  6. Feature toTagged Value assignmentshavetobedone in do blocks • Stereotypes areonlyassignedimplicitly • Tagged Values areonlyassignedimplicitly • Knowledgeoftechnicaldetailsof UML APIs Profile Support in ATL ATL Code Excerpt module AFG2UML; create OUT:UML from IN:AFG, IN2:PRO; helper def: ste : PRO!Stereotype = PRO!Stereotype.allInstances() -> select(e|e.name = 'AnalysisEntityType').first()); abstractrule ET_2_Class { from s : AFG!EntityType to t : UML!Class ( isAbstract <- s.noInstances ) } rule AnalysisET_2_Class extends ET_2_Class{ from s : AFG!AnalysisEntityType to t : UML!Class do{ t.applyStereotype(ste); --assigntaggedvaluesfrom super stereotypes if(not s.avgOccurrence.oclIsUndefined()){ t.setTaggedValue(ste,'avgOccurrence',s.avgOccurrence); } ... } }

  7. Profilesas First Class Language Descriptions Approach #1: Merge UML metamodelwithprofile AFG Model UML_base «profile» AFG ATL «metaclass» Class «stereotype» EntityType Class avgOccurrence:Int minOccurrence:Int maxOccurrence:Int isAbstract:Bool UML_extModel «stereotype» AnalysisEntityType «stereotype» DesignEntityType phase :String store : String merge UML Model merge UML_ext Merge Rules Class isAbstract:Bool EntityType stereotypeA «stereotype» stereotypeA avgOccurrence:Int minOccurrence:Int maxOccurrence:Int AnalysisEntityType DesignEntityType phase : String store : String

  8. Profilesas First Class Language Descriptions Approach #1: ATL Code module AFG2UML; createOUT:UML_extfrom IN:AFG; abstractrule ET_2_ET { from s : AFG!EntityType to t : UML!EntityType ( isAbstract <- s.noInstances, avgOccurrence <- s.avgOccurrence, minOccurrence <- s.minOccurrence, maxOccurrence <- s.maxOccurrence ) } rule AnalysisET_2_AnalysisET extends ET_2_ET{ from s : AFG!AnalysisEntityType to t : UML!AnalysisEntityType( phase <- s.phase) } UML_ext Class isAbstract:Bool EntityType avgOccurrence:Int minOccurrence:Int maxOccurrence:Int AnalysisEntityType DesignEntityType phase : String store : String

  9. Profilesas First Class Language Descriptions Getsevenmore complicatedwhen severalprofilesareused! Approach #1: Drawbacks UML_base «profile» AFG «metaclass» Class Class isAbstract:Bool «stereotype» Active «stereotype» … «stereotype» Persistent merge merge UML_ext Class …. Persistent Active …. Persistent/Active

  10. Profilesas First Class Language Descriptions Approach #2: Providing a Preprocessor Extend ATL syntax for applying • Profiles • Stereotypes Tagged Values to Feature assignments • Standard assignment operator Benefits • Reusable Feature to Tagged Value assignments • Stereotypes are assigned explicitly • Tagged values are assigned explicitly • Abstraction from UML APIs ATL4pro AFG Model UML Model AFG Model ATL UML Model AFG Profile UML API

  11. Profilesas First Class Language Descriptions Approach #2: ATL Code module AFG2UML; create OUT:UML usingAFG_Profile:PROfrom IN:AFG; abstractrule ET_2_ET { from s : AFG!EntityType to t : UML!ClassapplyPRO!EntityType ( isAbstract <- s.noInstances, avgOccurrence <- s.avgOccurrence, minOccurrence <- s.minOccurrence, maxOccurrence <- s.maxOccurrence ) } rule AnalysisET_2_AnalysisET extends ET_2_ET{ from s : AFG!AnalysisEntityType to t : UML!ClassapplyPRO!AnalysisEntityType( phase <- s.phase ) } • Differencestostandard ATL • using • from … IN2:AFG_Profile • apply helperdef: ste : PRO!Stereotype =PRO!Stereotype.allInstances()->select(e|e.name = 'AnalysisEntityType').first()); • t.applyStereotype(ste); • Feature to Tagged Values Assign. • if(not s.avgOccurrence. • oclIsUndefined()){ • t.setTaggedValue(ste, 'avgOccurrence', • s.avgOccurrence); • }

  12. Profilesas First Class Language Descriptions Approach #3: Extending ATL Syntax and Compiler Solution #2 drawback • No debugging support Benefits of extending ATL directly • No preprocessing of • Metamodels/models • ATL code • Complete tool support of ATL ATL AFG Model UML Model AFG Model ATL_VM UML Model AFG Profile UML API

  13. Conclusion & Ongoing Work • Profiles are important for several transformations scenarios • Some transformations may be generated from high-level mappings • Most transformation code must be written by hand • Profiles as first class language extensions provide • Shorter ATL transformations • Tooling issues: Static checking & code completion • Higher-order transformations: Easier matching/rewriting • Ongoing work • Provide an experimental ATL variant: ATL4pros (ATL for profiles ;-) • Provide new keywords • Extend the ATL compiler • Provide static checking for profile information • Provide code completion facilities • Explore other profile usage scenarios such as forward engineering

  14. Danke für die Aufmerksamkeit Thank you for your attention Merci pour l'attention DE_2_EN.atl EN_2_FR.atl

More Related