Presentation is loading. Please wait.

Presentation is loading. Please wait.

A REFACTORING TOOL FOR DESIGN PATTERNS WITH MODEL TRANSFORMATIONS Zekai Demirezen Yasemin Topaloğlu Ege University Department of Computer Engineering

Similar presentations


Presentation on theme: "A REFACTORING TOOL FOR DESIGN PATTERNS WITH MODEL TRANSFORMATIONS Zekai Demirezen Yasemin Topaloğlu Ege University Department of Computer Engineering"— Presentation transcript:

1 A REFACTORING TOOL FOR DESIGN PATTERNS WITH MODEL TRANSFORMATIONS Zekai Demirezen Yasemin Topaloğlu Ege University Department of Computer Engineering zekai@mail.ege.edu.tr yasemin.topaloglu@ege.edu.tr

2 2/23NWUML06, 12 June 2006 Agenda Background –Design Pattern: A Target for Refactoring –Pattern Specification and Metamodeling –Transformation MetaModels –XML Metadata Interchange Tool Architecture –Components of the tool –Transformations Case Study: Observer Design Pattern –Example MetaModels and Models –Screen Shots Conclusions

3 3/23NWUML06, 12 June 2006 OTHER INPUTS ???? Design Pattern: A Target for Refactoring Design Model with design patterns

4 4/23NWUML06, 12 June 2006 "from human-readable ……………………to computer-understandable" Pattern Specification

5 5/23NWUML06, 12 June 2006 Role-Based Meta-Modelling In order to process models in transformation activities, meta- modeling is required. Meta-modeling defines the rules and the structures of models. Role-based meta-modeling technique is proposed by (France et al,2004) for design pattern meta-modeling. Structural Pattern Specification (SPS) Interaction Pattern Specification (IPS) State Machine Pattern Specification (SMPS)

6 6/23NWUML06, 12 June 2006 OMG 4 Layer Architecture What we want to transform

7 7/23NWUML06, 12 June 2006 Transformation Meta-Models Source Meta-Model defines the models that the transformation will be applied. Transformation Meta-Model defines the transformation rules and the steps. Target Meta-Model defines the output model of the transformation activity. Model b Model a instanceOf Source Meta-Model instanceOf Definition of transformation T: A->B An application of transformation T(a) = b instanceOf Target Meta-Model

8 8/23NWUML06, 12 June 2006 Tool Inputs Design Model with design patterns Source MetaModel Target MetaModel Transformation MetaModel

9 9/23NWUML06, 12 June 2006 XML Metadata Interchange(XMI) XMI is a widely used interchange format for sharing objects using XML.

10 10/23NWUML06, 12 June 2006 Tool Architecture Model editor is a standard modeling tool such as Rational Rose that can be used to prepare the application design models. Rule editor is used to prepare the source and the target meta-models Transformation Preparer takes the application model and the source and the target meta-models as inputs and then matches the application model elements with the meta-elements. Transformation machine executes the transformation steps defined in transformation meta-model Tool Architecture (A. Wagner, 2002)

11 11/23NWUML06, 12 June 2006 Subcomponents of the Tool Representation Transformer (RT): It transforms the meta-model’s XMI representation to object representations by transforming Transformation Pattern Generator (TPG): This component produces transformation meta-model at run-time by analyzing structural differences between the source and target meta-models Rol-ModelElement Transformer (REM): This component matches the roles with application model elements. Matching activity is a kind of searching process of role’s structural properties in the application model. Transformation Machine(TM): It is the last component that executes the transformation meta-model tasks on the application model. Add, delete and update operations assign the role properties in to the selected model elements

12 12/23NWUML06, 12 June 2006 Transformations-1 XML Representation-Object Representation Transformation: The source, target and the application models in XMI are transformed into the objects representations. Composite Transformation Transformation Reuse is defined in Appukuttan et al 2003

13 13/23NWUML06, 12 June 2006 MetaModel-Model Transformation: The roles constituting the target meta-model are matched with the application model elements and the source meta-model- source model transformation is the result of this matching Transformations-2

14 14/23NWUML06, 12 June 2006 Application Model-Result Application Model Transformation: Model elements in the application model are transformed into the model elements of the target model by processing the steps in the transformation model. Transformation specifications in the transformation machine are applied on the application model in this transformation. Transformations-3

15 15/23NWUML06, 12 June 2006 Result Application Model Object Representation-XMI Representation Transformation: This step transforms the result model of the transformation process into the XMI format. Each model element is transformed into the corresponding element in the XMI format Transformations-4

16 16/23NWUML06, 12 June 2006 Overview

17 17/23NWUML06, 12 June 2006 Case Study We demonstrate the usage of our tool for the Observer [Gamma et al.] pattern. Observer pattern describes the situation in which a one-to-many dependency between objects is present. In this case, when one object changes state, all its dependents are notified and updated automatically

18 18/23NWUML06, 12 June 2006 Case Study:Source Meta-Model Preparing the Observer Source MetaModel Specification Applicability and motivation sections of the patterns in the catalogue are problem definitions for patterns In some parts we use stereotypes in order to provide problem semantics. During stereotype usage, we prefer to use universal standard stereotypes.

19 19/23NWUML06, 12 June 2006 Case Study:Target Meta-Model Preparing Observer Target MetaModel Specification The target specification is the solution of the design pattern. We use the Class structure and the Participants sections of the GOF Design Pattern catalogue to derive this specification. Semantic parts of the design pattern target specification are supported by the stereotype usage.

20 20/23NWUML06, 12 June 2006 Case Study: Application of the Tool After the rule definition activities, tool is executed for transformation with the application model.

21 21/23NWUML06, 12 June 2006 Case Study: Transformation Model TPG Component takes these two models and prepares transformation model with using Add Delete Update Unchanged labels.

22 22/23NWUML06, 12 June 2006 Case Study:Screen Shots

23 23/23NWUML06, 12 June 2006 Conclusions We introduced a transformation tool that performs horizontal transformations for design pattern refactorings on design models. Since XMI is not a query language, we could not generate complex definitions of the source model. However, our approach in the implementation of the tool does not require to define transformation meta rules which simplifies the transformation implementation.


Download ppt "A REFACTORING TOOL FOR DESIGN PATTERNS WITH MODEL TRANSFORMATIONS Zekai Demirezen Yasemin Topaloğlu Ege University Department of Computer Engineering"

Similar presentations


Ads by Google