Published on

slides of my thesis (Diplomarbeit) defense:
"View based modeling"

Published in: Education, Technology, Travel
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Concerning the disadvantage: the EMF generator model will generate the KobrA2 editor. Source code adaption needed afterwards for erasing unnecessary UML model elements
  • The visual representation of the six model transformations
  • Topcased has no layout algorithms for UML Activity model. Same applies for the initialization of UML Sequence model; even more Topcaed can only initialize Lifeline. Other elements are left.
  • Only one way can be shown: KobrA2 Activity model to UML Sequence. The other way can’t be show due to Topcased. So no formal equivalence.
  • DA-Folien

    1. 1. * <ul><li>View-based modeling </li></ul><ul><li>(thesis presentation) </li></ul><ul><li>by Jan Kadathukalam </li></ul><ul><li>Supervised by  M. Sc. Dietmar Stoll </li></ul><ul><li>Lehrstuhl Softwaretechnik </li></ul><ul><li>Universität Mannheim </li></ul>
    2. 2. Overview <ul><li>Short motivation of the view based modeling </li></ul><ul><li>Describing the work done for the thesis: </li></ul><ul><ul><li>KobrA2 metamodeling with Eclipse UM2/EMF </li></ul></ul><ul><ul><li>View based model transformations with ATL </li></ul></ul><ul><ul><ul><li>UML Activity and UML Sequence models are equivalent ? </li></ul></ul></ul><ul><ul><li>Validation of models by OCL </li></ul></ul><ul><ul><li>Architectural note </li></ul></ul><ul><li>Summary </li></ul>
    3. 3. View-based Modeling <ul><li>During development process different artifacts/views are created: </li></ul><ul><ul><li>UML Class diagram </li></ul></ul><ul><ul><li>UML Activity diagram </li></ul></ul><ul><ul><li>Source code </li></ul></ul><ul><li>These artifacts/views are loosely coupled </li></ul><ul><li> no consistency between these artifacts/views </li></ul><ul><li>Solution: </li></ul><ul><li>introducing a single underlying model (SUM) for all of these artifacts/views </li></ul><ul><li>Artefacts/Views generated by model transformations from the SUM </li></ul><ul><li> Consistency can be achieved </li></ul>
    4. 4. View-based Modeling <ul><li>Views generated by model transformations from the SUM </li></ul><ul><li>figure taken from [1] </li></ul>
    5. 5. KobrA2 Metamodel as SUM <ul><li>The KobrA approach enhances the MDA approach by describing precisely which artefacts/views should be generated when . </li></ul><ul><li>SUM Package Overview [2] : </li></ul>
    6. 6. Topics of this work <ul><li>Adapting the KobrA2 metamodel in Eclipse Ecore : </li></ul><ul><ul><li>focus on Behavioral realization (that is the KobrA2 Activity model) </li></ul></ul><ul><li>Comparing the KobrA2 Behavioral Realization View models </li></ul><ul><ul><li> View models are here UML Activity diagram and UML Sequence diagram </li></ul></ul><ul><ul><li>Equivalence between these two ? </li></ul></ul><ul><li>attach the OCL rules on SUM and view models </li></ul><ul><ul><li> utilizing Topcased OCL </li></ul></ul><ul><li>View based model transformations with ATL </li></ul><ul><ul><li>from SUM to UML Activity model and back </li></ul></ul><ul><ul><li>from SUM to UML Sequence model and back </li></ul></ul><ul><ul><li>Applying KobrA2-specific Profiles and Stereotypes </li></ul></ul><ul><ul><li>Synchronization between View models and SUM ? </li></ul></ul>
    7. 7. Metamodeling the SUM in Ecore <ul><li>KobrA2 metamodel is specialization of the UML Metamodel </li></ul><ul><ul><li>Two approaches for UML-metamodeling exists: </li></ul></ul><ul><ul><ul><li>Heavyweight extension of Eclipse UML metamodel </li></ul></ul></ul><ul><ul><ul><li>Middleweight extension of Eclipse UML metamodel </li></ul></ul></ul><ul><li> Middleweight extension used </li></ul><ul><ul><ul><li>Reason : „If your DSL on the other hand has much overlap with UML, you could consider using middleweight extensions “ [3] </li></ul></ul></ul><ul><ul><li>Middleweight extension copies the whole UML metamodel </li></ul></ul><ul><ul><ul><li>Advantage : easier to model with, easier to generate code </li></ul></ul></ul><ul><ul><ul><li>Disadvantage: Adaption of the generated SUM editor needed </li></ul></ul></ul><ul><ul><ul><li> getting rid of unnecessary UML model elements ( Use Case Element, Deployment model elements…) </li></ul></ul></ul>
    8. 8. SUM Behavior:Activities and SUM Structure in Ecore SUM::Behavior::Activities is derived from UML::Activities  Instances of SUM Behavior::Activities are the derived UML Activity model SUM::Structure::Classes is derived from UML::Classes  Instances of SUM Structure are the derived UML Class model
    9. 9. SUM to View transformations <ul><li>The SUM::Behavior::Activities metamodel is derived from UML::Activities </li></ul><ul><li> Instances of SUM::Behavior::Activities metamodel are an derived Activity model (that is, an UML Activity model with additional OCL constraints) </li></ul><ul><ul><li>Question: Is it possible to transform an instance of </li></ul></ul><ul><ul><li> SUM::Behavior::Activities into UML Sequence model ? </li></ul></ul><ul><ul><li> Equivalence of UML Activity model and UML Sequence model ? </li></ul></ul><ul><ul><li>One answer from Robin [4]: “ equivalent information than the activity diagram , but from a time-centered, reactive view , instead of a action-centered, imperative view” </li></ul></ul>
    10. 10. Showing the equivalence between UML Activity and UML Sequence model <ul><li>Proving the equivalence of an UML Activity and UML Sequence model is not possible due to the huge amount of elements ! </li></ul><ul><li> Narrow the elements down to the most commonly used: </li></ul><ul><li>Create an usecase (here: charging a credit card) </li></ul><ul><li>Show this usecase in an UML Activity diagram </li></ul><ul><li>Show this usecase in an equivalent UML Sequence diagram </li></ul><ul><li> if possible, visually equivalent </li></ul><ul><li>Adapt this usecase for the KobrA2 Activity model ( SUM Behavior mode) </li></ul><ul><li>Transform the SUM Behavior model to View model (UML Activity model) </li></ul><ul><li>Transform the SUM Behavior model to View model (UML Sequnce model) </li></ul><ul><li>Transform View model (UML Activity model) to SUM Behavior </li></ul><ul><li>Transform View model (UML Sequence model) to SUM Behavior </li></ul><ul><li> if possible, the usecase is formally equivalent </li></ul>
    11. 11. Usecase example of the Kobra2 View model (as an UML Activity diagram)
    12. 12. Equivalent Kobra2 View model as an UML Sequence diagram
    13. 13. Equivalence of UML Activity model and UML Sequence model ? <ul><li>Usecase shows: visually equivalent ! </li></ul><ul><li>Still to show: formally equivalent by model transformations </li></ul><ul><li>Thus the following model transformations will show two things: </li></ul><ul><ul><li>the usecase models are formally equivalent or not </li></ul></ul><ul><ul><li>Concept of the View-based modeling: </li></ul></ul><ul><ul><ul><li>Creating different views (UML Activity and Sequence model) from one single underlying model model (SUM) </li></ul></ul></ul><ul><ul><ul><li>Consistency between view models </li></ul></ul></ul>
    14. 14. KobrA2 Model Transformations <ul><li>Model transformations needed to transform SUM to View Models and back </li></ul><ul><ul><li>ATL is being used here </li></ul></ul><ul><ul><li>View models are UML models with KobrA2 specific Stereotypes </li></ul></ul><ul><ul><ul><li> UML Profile /Stereotype application necessary </li></ul></ul></ul><ul><li>six transformations: </li></ul><ul><ul><li>SUM Behavior  View model (UML Activity) </li></ul></ul><ul><ul><li>SUM Behavior  View model (UML Sequence) </li></ul></ul><ul><ul><li>SUM Structure  View model (UML Class) </li></ul></ul><ul><ul><li>View model (Activity diagram)  SUM Behavior </li></ul></ul><ul><ul><li>View model (Sequence diagram)  SUM Behavior </li></ul></ul><ul><ul><li>View model (UML Class)  SUM Structure </li></ul></ul>
    15. 15. Visualization of the transformations
    16. 16. ATL Transformations (SUM to View) <ul><li>SUM to View model (Activity model) is straightforward </li></ul><ul><ul><li>SUM::Behavior::Activities is derived from UML::Behavior:Activites </li></ul></ul><ul><ul><li> 1:1 mapping </li></ul></ul><ul><li>SUM Structure  View model (UML Class) is also straightforward </li></ul><ul><ul><li>SUM::Structure is derived from UML::Structure </li></ul></ul><ul><ul><li> 1:1 mapping </li></ul></ul><ul><li>SUM to View model (Sequence model) is not that easy </li></ul><ul><ul><li>The instances of SUM::Behavior::Activities are flat and are connected by ControlFlows while the elements of the Sequence models can have a hierarchical structure [ 5 ] </li></ul></ul><ul><ul><li> e.g. conditional execution and paralell execution are organized in a hierarchical manner in the UML Sequence model </li></ul></ul>
    17. 17. Transformation rules (SUM to UML Sequence model ) <ul><li>The essence of the transformations: </li></ul><ul><ul><li>RaiseExceptionAction has no equivalent element in UML Sequence model </li></ul></ul><ul><ul><li>it‘s possible to map all other elements from KobrA2 Activitiy model to an equivalent element in UML Sequence model </li></ul></ul><ul><ul><li>Some Mapping rules : </li></ul></ul>InteractionOperand K2ControlFlow CombinedFragment K2DecisionNode, K2ForkNode Lifeline K2ActivityPartition CallEvent,MessageOccurrenceSpecification, BehaviorExecutionSpecification, Message K2CallOperationAction Interaction K2Activity <ul><ul><li>Package, Collaboration </li></ul></ul>K2Package UML Sequence element KobrA2 Activity element
    18. 18. Transformation rules (SUM to UML Sequence model ) <ul><li>Why this mapping : </li></ul><ul><li>K2CallOperationAction  CallEvent, MessageOccurrenceSpecification, BehaviorExecutionSpecification, Message </li></ul><ul><ul><li>Visually, K2CallOperationAction will be mapped to UML BehaviorExecutionSpecification and UML Message </li></ul></ul><ul><ul><li>But UML Message is connected to CallEvent and MessageOccurrenceSpecification </li></ul></ul><ul><li> Utilize ATL‘s internal referencing system („unique lazy rule“) and perform the transformation and referencing in one rush </li></ul>
    19. 19. Transformation rules (SUM to UML Sequence model ) <ul><li>conditional execution and paralell execution are organized in a hierarchical manner in the UML Sequence model </li></ul><ul><li> concerning this rule: K2DecisionNode, K2ForkNode  CombinedFragment </li></ul><ul><li>Hierarchical structure needs questions to be answered: </li></ul><ul><li>what comes first ? DecisionNode or ForkNode ? </li></ul><ul><li>How many of these nodes are there ? </li></ul><ul><li> create algorithms for answering them </li></ul>
    20. 20. Transformation rules (SUM to UML Sequence model ) <ul><li>The figure shows the algorithm for building the hierarchical structure for DecisionNodes: </li></ul>
    21. 21. Connecting UML Class and UML Activity/ UML Sequence model <ul><li>UML Operation elements in Class model can be referenced by UML CallOperationAction in Activity model and UML CallEvent in Sequence model </li></ul><ul><ul><li>Despite the ability of ATL to handle multiple input models and output </li></ul></ul><ul><ul><li>models, error messages arose : </li></ul></ul><ul><ul><li>Multipe inputs/outputs in conjunction with UML Profile/UML Stereotype application is a bad combination for ATL (v2.02 and v3.0) ? </li></ul></ul><ul><li> Referencing these models done programmatically in Java </li></ul>
    22. 22. Connecting UML Class and UML Activity/ UML Sequence model The Figure shows how UML class and the UML Activity or UML Sequence model get connected :
    23. 23. SUM to View Model (screenshots) Selecting the desired View transformation (here: UML Activity model): Resulting model with reference to the UML Class model: UML Editor In Topcased (after shaping* it) * Topcased lacks proper initialization of UML Activity and Sequence models
    24. 24. ATL Transformations (View to SUM) <ul><li>View model (Activity model) to SUM Activities is straightforward </li></ul><ul><li>View model (UML Class) to SUM Structure is also straightforward </li></ul><ul><li>View model (Sequence model) to SUM Activities could only be performed rudimentarily. </li></ul><ul><ul><li>Due to Topcased (v2.3-3.0): „CombinedFragment (and therefore InteractionOperand) are only managed graphically .“ [6] </li></ul></ul><ul><ul><li>Thus, formal equivalence of UML Activity and UML Sequence model can‘t be shown ! </li></ul></ul>
    25. 25. Validation of the models: Attaching OCL Rules to the metamodel <ul><li>The Eclipse OCL parser is used (MDT OCL) </li></ul><ul><li>Two approaches for attaching the OCL rules in Eclipse uml2 models: </li></ul><ul><ul><li>Directly in UML model (programmatically or using UML2 editor) </li></ul></ul><ul><ul><li>Using the Topcased OCL facility </li></ul></ul><ul><li>Here: Topcased OCL is used: </li></ul><ul><ul><li>comfortable OCL editor available </li></ul></ul><ul><ul><li>results are displayed more beautifully </li></ul></ul><ul><ul><li>No code generation required </li></ul></ul>
    26. 26. Topcased OCL Editor OCL rules are defined in a separate file: Apply the OCL rules for the SUM and UML:
    27. 27. <ul><li>Check model validation with Topcased OCL on SUM/UML: </li></ul>Topcased OCL Errors in model : Successful model validation:
    28. 28. Additional note: Architecture (SUM to View) ATL 2.x: Difficult to invoke UML Stereotype application programmatically  using ATL‘s wrapper class VMLauncher ATL 3.0 : Much improvement to the API  no need for an extra wrapper class, now ATL can deal Eclipse-specific URIs directly
    29. 29. Summary <ul><li>View-based Modeling can help achieving consistency between the artifacts/views. </li></ul><ul><li>But Consistency needs synchronisation of the models : </li></ul><ul><li> additional tracing mechanism of the model transformation language </li></ul><ul><ul><li>ATL does not provide such traceability for different metamodels </li></ul></ul><ul><ul><li>Promising research project : SyncATL [7] </li></ul></ul><ul><li>This work shows : </li></ul><ul><ul><li>KobrA2 metamodel in Ecore </li></ul></ul><ul><ul><li>KobrA2 Activity model can be transformed to an equivalent UML Sequence model </li></ul></ul><ul><ul><li>How OCL constraints can be applied to SUM and View models </li></ul></ul>
    30. 30. References <ul><ul><li>[1] D. Stoll, C. Atkinson: Orthographic Modeling Environment , </li></ul></ul><ul><ul><li> FASE 2008 </li></ul></ul><ul><ul><li>[2] D. Stoll: KobrA 2 Metamodel (Version of: December 7, 2008) </li></ul></ul><ul><ul><li>[3] J. Bruck, K. Hussey: Customizing UML: Which Technique is </li></ul></ul><ul><ul><li> Right for You? June 2008 </li></ul></ul><ul><ul><li>[4] J. Robin: Behavioral Modeling with UML2 Superstructure, Lecture slides 2007 </li></ul></ul><ul><ul><li>[5] X. Li, Z. Liu, H. Jifeng: A formal semantics of UML sequence diagram, ASWEC 2004 </li></ul></ul><ul><ul><li>[6] Laurent: Sequence diagram:Execution not attached to InteractionOperand, Topcased mailing list January 2009 </li></ul></ul><ul><ul><li>[7] Y. Xiong et al.: Towards automatic model synchronization from model transformations, ASE 2007 </li></ul></ul>