OORPT Object-Oriented Reengineering Patterns and Techniques 13. Model-Driven Development Prof. O. Nierstrasz.

Slides:



Advertisements
Similar presentations
Profiles Construction Eclipse ECESIS Project Construction of Complex UML Profiles UPM ETSI Telecomunicación Ciudad Universitaria s/n Madrid 28040,
Advertisements

The role of OCL in the Model Driven Architecture Jos Warmer Klasse Objecten
Intermediate Code Generation
June 9, 2006 Transforming models with ATL © 2006 ATLAS Nantes Transforming models with ATL The A TLAS Transformation Language Frédéric Jouault ATLAS.
OCL2 April A presentation of OCL 2 Object Constraint Language Christian Hein, Fraunhofer FOKUS April 2006.
Production Rule Representation Team Response Presentation to BEIDTF OMG Montreal Aug 2004 Ruleml.org.
Query/Views/Transformations © 2006 ATLAS Nantes Query/Views/Transformations An introduction to the MOF 2.0 QVT standard with focus on the Operational.
Families to Persons © 2007 ATLAS Nantes "Families to Persons" A simple illustration of model-to-model transformation Freddy Allilaire Frédéric Jouault.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
ESE Einführung in Software Engineering 10. Software Architecture Prof. O. Nierstrasz.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
Metamodeling and Metaprogramming Seminar 1. Introduction Prof. O. Nierstrasz Spring Semester 2008.
Sheet 1© 2005 Lentedagen, 30 March-1 April 2005 IPA Lentedagen on Software Architecture Model Transformations in MDA Ivan Kurtev.
MDE In A Sales Management System: A Case Study © 2008 INRIA, TUD & SAP MDE In A Sales Management System: A Case Study Mathias Fritzsche, Hugo Bruneliere,
MDD Tutorial for managers Eclipse ECESIS Project A presentation of MDD basics Model-driven development (MDD) tutorial for managers EUROPEAN SOFTWARE INSTITUTE,
XML Metadata Interchange (XMI)
Comparing M2T & M2M Complementary Approaches © 2008 INRIA, University of York & SINTEF Comparing M2T & M2M Complementary Approaches Hugo Bruneliere,
NIEM-UML Profile Justin Stekervetz, NIEM PMO
Spectra Software Defined Radio Products Applying Model Driven Design, Generative Programming, and Agile Software Techniques to the SDR Domain OOPSLA '05.
Advanced Applications Of Model-to-Model Transformation © 2008 INRIA Advanced Applications Of Model-to-Model Transformation Hugo Bruneliere & Frédéric.
Composing Models: Principles & Techniques © Copyright TUBS & TUD Composing Models: Principles & Techniques Steven Völkel & Jendrik Johannes.
MDA Guide Version CYT. 2 Outline OMG Vision and Process Introduction to MDA How is MDA Used? MDA Transformations Other MDA Capabilities Using the.
A Survey of Software Refactoring Tom Mens, Tom Tourwé
An Approach and Tool for Synchronous Refactoring of UML Diagrams and Models Using Model-to-Model Transformations Hafsteinn Þór Einarsson Helmut Neukirchen.
Model Transformations
Faculty of Informatics and Information Technologies Slovak University of Technology Peter Kajsa and Ľubomír Majtás Design.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
MDA and QVT  Tom Gullion, Director of Product Management, Together Products.
An Introduction to Software Architecture
MDE Model Driven Engineering Xavier Blanc Université Pierre et Marie Curie
Model transformation with a dedicated imperative language IRISA Rennes (France) - Triskell team Jean-Marc Jézéquel Didier Vojtisek Jean-Philippe Thibault.
Introduction to MDA (Model Driven Architecture) CYT.
Model Handling with EMF Eclipse ECESIS Project Model handling with EMF An introduction to the Eclipse Modeling Framework ATLAS group (INRIA & LINA),
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
Alignment of ATL and QVT © 2006 ATLAS Nantes Alignment of ATL and QVT Ivan Kurtev ATLAS group, INRIA & University of Nantes, France
I T & S A e r o s p a c eD e f e n c e THALES Research & Technology THALES recommendations for the final OMG standard on Query / Views / Transformations.
What is MOF? The Meta Object Facility (MOF) specification provides a set of CORBA interfaces that can be used to define and manipulate a set of interoperable.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
Chapter 06 (Part I) Functions and an Introduction to Recursion.
UML Profiles Eclipse ECESIS Project The UML Profile technology SOFTEAM 144 Ave des Champs Elysées Paris, France
Usage of OCL April Usage of OCL for design guidelines of models Christian Hein, Fraunhofer FOKUS April 2006.
University of Southern California Center for Systems and Software Engineering Model-Based Software Engineering Supannika Koolmanojwong Spring 2013.
WP 3.3 © Copyright Xactium, TUBS & TUD How to build a set of DSLs: from Theory to Practise Xactium, TUBS, Jendrik Johannes (TUD)
Model Driven Development An introduction. Overview Using Models Using Models in Software Feasibility of MDA MDA Technologies The Unified Modeling Language.
Introduction to Model-Driven Simulation © 2008 SAP, TU Dresden, XJ Technologies Introduction to Model-Driven Simulation Mathias Fritzsche 1, Jendrik.
An ATL Example © 2005 ATLAS Nantes An ATL Example The BibTeXML to DocBook Transformation ATLAS group (INRIA & LINA), University of Nantes, France.
December 4, ICSSEA’03 The SmartTools Software Factory The MDA approach and Generative programming for Software Development:
Model transformation with a dedicated imperative language IRISA Rennes (France) - Triskell team Jean-Marc Jézéquel Didier Vojtisek Jean-Philippe Thibault.
1 Technical & Business Writing (ENG-715) Muhammad Bilal Bashir UIIT, Rawalpindi.
ModTransf A Simple Model to Model Transformation Engine Cédric Dumoulin.
Introduction To Model-to-Model Transformation © 2008 INRIA Introduction To Model-to-Model Transformation Hugo Bruneliere & Frédéric Jouault INRIA.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
UML Profile BY RAEF MOUSHEIMISH. Background Model is a description of system or part of a system using well- defined language. Model is a description.
An Introduction to Metamodelling Eclipse ECESIS Project An Introduction to Metamodelling Principles & Fundamentals Department of Computer Science,
Ontologies Reasoning Components Agents Simulations An Overview of Model-Driven Engineering and Architecture Jacques Robin.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
Sheet 1MDAFA2004 Linköping, June 2004 A Language for Model Transformations in the MOF Architecture Ivan Kurtev, Klaas van den Berg University of Twente,
Page 1 Hitachi Ltd. – FhI FOKUS TTCN-3 User Conference, June 2005 MDA based approach for generation of TTCN-3 test specifications Hideto Ogawa, Hitachi.
Chapter 5 – System Modeling Lecture 1 1Chapter 5 System modeling.
Object-Oriented Analysis and Design
Model-Driven Ontology Engineering
Evaluating Compuware OptimalJ as an MDA tool
An Introduction to Software Architecture
Model Driven Software Development
Software Architecture & Design
Presentation transcript:

OORPT Object-Oriented Reengineering Patterns and Techniques 13. Model-Driven Development Prof. O. Nierstrasz

OORPT — Architecture Recovery 10.2 Roadmap  Introduction to Model Engineering —Models and metamodels —MDA —Models as graphs  Query/Views/Transformations —QVT languages: Relations, Core, Operational Mappings —Case study: flattening UML hierarchies

OORPT — Architecture Recovery 10.3 Sources  Introduction to Model Engineering —Jean Bézivin  Query/Views/Transformations —ATLAS group, INRIA & University of Nantes  Model Driven Development —Colin Atkinson, Universität Mannheim

OORPT — Architecture Recovery 10.4 Roadmap  Introduction to Model Engineering —Models and metamodels —MDA —Models as graphs  Query/Views/Transformations

OORPT — Architecture Recovery 10.5 The Vision of MDA software developer Platform Independent Model automatic translation

OORPT — Architecture Recovery 10.6 procedural technology component technology object technology Objects, Classes, Smalltalk, C++,... Procedures, Pascal, C,... Packages, Frameworks, Patterns, … procedural refinement model technology Models, Metamodels, UML, OCL, MOF, XMI, SPEM, CWM … object composition model transformation A global view of software engineering evolution

OORPT — Architecture Recovery 10.7 Roadmap  Introduction to Model Engineering —Models and metamodels —MDA —Models as graphs  Query/Views/Transformations

OORPT — Architecture Recovery 10.8 Modeling is essential  Modeling is essential to human activity because every action is preceded by the construction (implicit or explicit) of a model.  The medical technique of bloodletting was based on an incorrect model of the body [1]. If the model is incorrect, the action may be inappropriate [2]. 1.Hippocrates and many others believed that the four crucial elements earth, air, water and fire were balanced within the human body as the four humors: blood, phlegm, and black and yellow bile. In this context, disease was due to an imbalance in the four humors and treatment involved restoring their balance through bloodletting. 2.Georges Washington died after heavy blood loss sustained in a bloodletting treatment for laryngitis.

OORPT — Architecture Recovery What is a model?  Modeling, in the broadest sense, is the cost-effective use of something in place of something else for some cognitive purpose. It allows us to use something that is simpler, safer or cheaper than reality instead of reality for some purpose. A model represents reality for the given purpose; the model is an abstraction of reality in the sense that it cannot represent all aspects of reality. This allows us to deal with the world in a simplified manner, avoiding the complexity, danger and irreversibility of reality. – “The Nature of Modeling.” Jeff Rothenberg. In Artificial Intelligence, Simulation, and Modeling, John Wiley and Sons, Inc., 1989, pp

OORPT — Architecture Recovery A model is a partial view of a system Respiratory model Other Models muscular, nervous, circulatory, digestive, endocrinous, etc. Skeleton model A system Several models of this system (partial views) repOf

OORPT — Architecture Recovery Carpenter's view Mason's view Plumber's view Architect's view Landlord's view Renter's view Interior Designer's view Tax Collector's view Electrician's view Each view is expressed in a given domain language (DSL). Vocabularies of different corporations are different; However they allow talking about a common building. Model repOf System Multiples views and coordinated DSLs

OORPT — Architecture Recovery Aspects of a system represented by models A given system may have plenty of different models. Each model represents a given aspect of the system. Ma S S isRepresentedBy M0M0 M1M1 Mb Mc

OORPT — Architecture Recovery Don't confuse the model and the system

OORPT — Architecture Recovery Percentage of places infested by termites in France. First round of political election in France in A model has no meaning when separated from its metamodel

OORPT — Architecture Recovery The legend in the map is a metamodel basedOn

OORPT — Architecture Recovery This is DSL X DDMM Model a Model b Model c Model d This is DSL Y This is DSL Z Definition: A DSL is a coordinated set of models DDMM = Domain Definition MetaModel Metamodels define Domain Specific Languages (DSLs)

OORPT — Architecture Recovery What is a model? A model is a representation of a system —A model is written in the language of its unique metamodel —A metamodel is written in the language of its unique metametamodel – The unique MMM of the MDA is the MOF —A model is a constrained directed labeled graph —A model may have a visual graphical representation (sometimes)

OORPT — Architecture Recovery Roadmap  Introduction to Model Engineering —Models and metamodels —MDA —Models as graphs  Query/Views/Transformations

OORPT — Architecture Recovery Production of a system from a model S M Production of a system from a model. For example construction a building from its floor plans. M repOf S {postcondition}

OORPT — Architecture Recovery M1M1 M2M2 M3M3 MDA in a nutshell - One unique Metametamodel (the MOF) - An important library of compatible Metamodels, each defining a DSL - Each of the models is defined in the language of its unique metamodel

OORPT — Architecture Recovery The OMG/MDA Stack the UML MetaModel ClassAttribute * 1 a UML Model Client Name : String M2M2 M1M1 the MOF Class Association source destination M3M3 c2     metamodel model "the real world" meta-meta model The MOF The UML metamodel ++ Some UML Models ++ Various usages of these models M0M0 M1M1 M2M2 M3M3  

OORPT — Architecture Recovery CORBA Java/EJB C#/DotNet Web/XML/SOAP PIM etc. Platform-Independent Model Multi-target code generation + SVG, GML, Delphi, ASP, MySQL, PHP, etc. data grid computing pervasive computing cluster computing SMIL/Flash Write Once, Run Anywhere Model Once, Generate Anywhere

OORPT — Architecture Recovery Forward and reverse engineering PSM Platforms of yesterday Platforms of tomorrow Platforms of today Legacy, Cobol, ADA, etc. Java, EJB, J2EE, etc. ???? Grid, Cluster, P2P architectures PIM

OORPT — Architecture Recovery Roadmap  Introduction to Model Engineering —Models and metamodels —MDA —Models as graphs  Query/Views/Transformations

OORPT — Architecture Recovery Structural definition of a model  Definition 1. A directed multigraph G = (N G, E G,  G ) consists of a finite set of distinct nodes N G, a finite set of edges E G and a mapping function  G : : E G  N G x N G  Definition 2. A model M = (G, ,  ) is a triple where: —G = (N G, E G,  G ) is a directed multigraph —  is itself a model, called the reference model of M, associated to a graph G  = (N , E ,  ) —  : N G  E G  N  is a function associating elements (nodes and edges) of G to nodes of G  (metaElements)

OORPT — Architecture Recovery Each model conforms to its reference model

OORPT — Architecture Recovery There are several kinds of models

OORPT — Architecture Recovery Definitions  Definition 3. A metametamodel is a model that is its own reference model (i.e. it conforms to itself).  Definition 4. A metamodel is a model such that its reference model is a metametamodel.  Definition 5. A terminal model is a model such that its reference model is a metamodel.

OORPT — Architecture Recovery Utilization definition  The objective here is to define the possible usages of a model. Consequently model will mean here "terminal model". —Definition 6. A system S is a delimited part of the world considered as a set of elements in interaction. —Definition 7. A model M is a representation of a given system S, satisfying the substitutability principle (see below). —Definition 8. (Principle of limited substitutability). A model M is said to be a representation of a system S for a given set of questions Q if, for each question of this set Q, the model M will provide exactly the same answer that the system S would have provided in answering the same question.

OORPT — Architecture Recovery Roadmap  Introduction to Model Engineering  Query/Views/Transformations —QVT languages: Relations, Core, Operational Mappings —Case study: flattening UML hierarchies

OORPT — Architecture Recovery Overview  QVT stands for Query/Views/Transformations  OMG standard language for expressing queries, views, and transformations on MOF models —OMG QVT Request for Proposals (QVT RFP, ad/ ) issued in 2002 —Seven initial submissions that converged to a common proposal —Current status (June, 2006): final adopted specification, OMG document ptc/

OORPT — Architecture Recovery Roadmap  Introduction to Model Engineering  Query/Views/Transformations —QVT languages: Relations, Core, Operational Mappings —Case study: flattening UML hierarchies

OORPT — Architecture Recovery QVT Operational Context  Abstract syntax of the language is defined as MOF 2.0 metamodel  Transformations (Tab) are defined on the base of MOF 2.0 metamodels (MMa, MMb)  Transformations are executed on instances of MOF 2.0 metamodels (Ma)

OORPT — Architecture Recovery QVT Architecture  Layered architecture with three transformation languages: —Relations —Core —Operational Mappings  Black Box is a mechanism for calling external programs during transformation execution

OORPT — Architecture Recovery QVT Languages  Relations —Declarative transformation language —Specification of relations over model elements  Core —Declarative transformation language —Simplification of Relations language  Operational Mappings —Imperative transformation language —Extends Relations language with imperative constructs QVT is a set of three languages that collectively provide a hybrid “language”.

OORPT — Architecture Recovery Roadmap  Introduction to Model Engineering  Query/Views/Transformations —QVT languages: Relations, Core, Operational Mappings —Case study: flattening UML hierarchies

OORPT — Architecture Recovery Case Study  Flattening UML class hierarchies: —given a source UML model transform it to another UML model in which only the leaf classes (classes not extended by other classes) in inheritance hierarchies are kept.  Rules: —Transform only the leaf classes in the source model —Include the inherited attributes and associations —Attributes with the same name override the inherited attributes —Copy the primitive types

OORPT — Architecture Recovery Source and Target Metamodel: SimpleUML

OORPT — Architecture Recovery Example Input Model

OORPT — Architecture Recovery Example Output Model

OORPT — Architecture Recovery transformation SimpleUML2FlattenSimpleUML(in source : SimpleUML out target : SimpleUML); ………………………………………………………………… main() {} ………………………………………………………………… …helpers…………………………………………… …mapping operations……………… transformation SimpleUML2FlattenSimpleUML(in source : SimpleUML out target : SimpleUML); ………………………………………………………………… main() {} ………………………………………………………………… …helpers…………………………………………… …mapping operations……………… Overall structure of a transformation program: Signature: Declares the transformation name and the source and target metamodels. in and out keywords indicate source and target model variables. Signature: Declares the transformation name and the source and target metamodels. in and out keywords indicate source and target model variables. Entry point: The execution of the transformation starts here by executing the operations in the body of main Entry point: The execution of the transformation starts here by executing the operations in the body of main Transformation elements: Transformation consists of mapping operations and helpers. They form the transformation logic. Transformation elements: Transformation consists of mapping operations and helpers. They form the transformation logic. Model Transformation expressed in Operational Mappings Language

OORPT — Architecture Recovery Mapping Operations  A mapping operation maps one or more source elements into one or more target elements —Always unidirectional —Selects source elements on the base of a type and a Boolean condition (guard) —Executes operations in its body to create target elements —May invoke other mapping operations and may be invoked —Mapping operations may be related by inheritance

OORPT — Architecture Recovery mapping Class::leafClass2Class(in model : Model) : Class when {not model.allInstances(Generalization)->exists(g | g.general = self)} { name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); } mapping Class::leafClass2Class(in model : Model) : Class when {not model.allInstances(Generalization)->exists(g | g.general = self)} { name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); } Operation body Signature and guard Mapping Operations: Example (1)  Consider the rule that transforms only leaf classes —Selects only classes without subclasses —Collects all the inherited properties —Creates new class in the target model

OORPT — Architecture Recovery mapping Class::leafClass2Class(in model : Model) : Class when {not model.allInstances(Generalization)->exists(g | g.general = self)} mapping Class::leafClass2Class(in model : Model) : Class when {not model.allInstances(Generalization)->exists(g | g.general = self)} Operation name Source element type An optional sequence of input/output parameters Target element type Guard The Guard is an OCL expression used to filter source elements of a given type. The mapping operation is executed only on elements for which the guard expression is evaluated to true. Mapping Operations: Example (2) Operation Signature and Guard

OORPT — Architecture Recovery name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); name:= self.name; abstract:= self.abstract; attributes:= self.derivedAttributes()->map property2property(self)->asOrderedSet(); Operation Body The predefined variable self refers to the source element on which the operation is executed The left-hand side of the assignments denotes properties of the target element Invocation of helper derivedAttributes The keyword map is used to invoke another mapping operation named property2property over the elements returned by the helper derivedAttributes The mapping operation body contains initialization expressions for the properties of the target element. When an operation is executed over a source element the self variable is bound to it and an instance of the target type is created. Then the operation body is executed. Mapping Operations: Example (3)

OORPT — Architecture Recovery Conclusions (1)  QVT: Query/Views/Transformations – the OMG standard language for model transformations in MDA/MDE  The issue of Views over models is not addressed  Query language based on OCL  A family of three transformation languages: —Relations: declarative language —Core: declarative language, simplification of Relations —Operational Mappings: imperative transformation language that extends relations  Collectively QVT languages form a hybrid language

OORPT — Architecture Recovery Conclusions (2)  Tool support is still insufficient (at the time of preparing of this lecture – June 2006)  QVT is not proved yet in non-trivial industrial like scenarios  Many issues need further exploration: —Performance —Testing —Scalability of transformations —Ease of use —Handling change propagation —Incremental transformations —Adequacy of the reuse mechanisms

OORPT — Architecture Recovery License  The present courseware has been elaborated in the context of the MODELWARE European IST FP6 project (  Co-funded by the European Commission, the MODELWARE project involves 19 partners from 8 European countries. MODELWARE aims to improve software productivity by capitalizing on techniques known as Model-Driven Development (MDD).  To achieve the goal of large-scale adoption of these MDD techniques, MODELWARE promotes the idea of a collaborative development of courseware dedicated to this domain.  The MDD courseware provided here with the status of open source software is produced under the EPL 1.0 license.