©2005 ATLAS Nantes How Adaptable is MDA? CTIT Symposium, University of Twente From Principles to...

Post on 14-Dec-2015

216 views 1 download

Tags:

Transcript of ©2005 ATLAS Nantes How Adaptable is MDA? CTIT Symposium, University of Twente From Principles to...

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

From Principles to Implementation:From Principles to Implementation:

Some Lessons Learned in the Some Lessons Learned in the

Building of the AMMA Model Building of the AMMA Model

Engineering PlatformEngineering Platform

Jean Bézivin Jean.Bezivin{noSpamAt}univ-nantes.fr

ATLAS Group (INRIA & LINA),University of Nantes, France

http://www.sciences.univ-nantes.fr/lina/atl/

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Model Driven EngineeringModel Driven Engineering

• ScheduleSchedule– Scope & ApplicabilityScope & Applicability– PrinciplesPrinciples– Deployment (AMMA)Deployment (AMMA)

• CreditsCredits– ModelwareModelware– Microsoft Microsoft – IBM IBM – TNITNI– SodifranceSodifrance

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Technical Space

Basic entities

System ModelrepOf

System: a group of interacting, interrelated, or interdependent elements forming a complex whole.

Model: an abstract representation of a system created for a specific purpose.

Technical Space: a representation system for models and a set of technical solutions to handle them.

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The playground

Pri

ncip

les

Pri

ncip

les

Sta

nd

ard

sS

tan

dard

s

Tools

Tools

TeachingTeaching

sNets, 1990

UML, 1995

today, AMMA

MOF, 2000

tomorrow

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Principles, standards and tools

Model-Driven Engineering (MDE)

MDA™ Model-DrivenArchitecture

(OMG)

EclipseEMFGMF

MIC Model

IntegratedComputing

GME

SoftwareFactories

(MS)

MicrosoftVisual StudioTeam system

DSL Tools

OtherStandards

OtherTools

Principles

Standards

Tools

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

IBM on MDA : Three complementary ideas

1.Direct representation 2.Automation 3.Standards

Direct representation => multiple languagesDanger of fragmentation

Need coordinationHow to coordinate?

Short answer: metametamodelBut what is a metametamodel?

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Agenda

Scope

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Introduction

• The industrial evolution (OMG MDA™, IBM EMF, Microsoft Software Factories) and the MDE trend

• The need for sound principles (models as first class entities)

• Technical spaces or why MDE is not sufficient. Multiple Technical Spaces inside MDE

EMF?

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The initial move: from Middleware to Modelware

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Latest tentative to define MDA

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Steve Cook (OOPSLA 2004 panel)

Suggests that MDA proponents fall into the following three camps:

1. The UML PIM camp: MDA involves the use of UML to build Platform Independent Models (PIMs) which are transformed into Platform Specific Models (PSMs) from which code is generated.

2. The MOF camp: MDA does not involve the use of UML, but instead the crucial technology is MOF, and the definition of modelling languages and language transformations using MOF.

3. The Executable UML camp: MDA involves building a UML compiler, making it a first class programming language.

Ref: Steve Cook Blog @: http://blogs.msdn.com/stevecook

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

MDA in a nutshell : PSM = f(PIM)

U n i v e r s i t é d e N A N T E S

M 1 , M 2 & M 3 s p a c e s

M 3

M 2

M 1

M 2

M 1

M 2

M 1 M 1M 1

- 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

M1

M2

M3

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The initial MDA conjecture : PSM = f(PIM)

PIMs(PlatformIndependentModels)

PSMs(PlatformSpecificModels)

MMerging phase

PDMs(PlatformDescriptionModels)

?weaving

PSM branch

PDM branchPIM branch

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Two missing links in the OMG architecture

PSM = f(PIM, PDM)or after currying:PSM = fPDM(PIM)

PIM PDM

PSM“numeric” values:PDM = DotNetPDM = EJB

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Microsoft Software Factories

• SDK (Team System) released in late 2004– First presentation at OOPSLA, Vancouver, Oct. 2004– See S. Cook, S. Kent, J. Greenfield and K. Short Blogs

• Aims to be closer to a metaCASE tool than Eclipse – (however follow GMF Borland)

• Not UML-based (nor MOF, nor XMI)• Models strongly tied to code

– Reverse engineering/synchronization– Reliance on Microsoft’s platforms (Visual studio)

… Modeling is the future …Bill Gates

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

MDE@Microsoft

• Microsoft is releasing a suite of tools to make it easy to construct graphical designers hosted in Visual Studio for editing domain specific languages (DSL).

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Creating a Petri net DSL

Metamodel: a couple oflogical and visual definitions

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Creating a Petri net DSL

Mapping on DotNet standard tools (C#, CLS, CLR, etc.)

We are far from the initial OMG PIM/PSM naive separation

However this is really MDE in 2005

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

A first attempt to reverse engineer the DSL Metametamodel

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Microsoft DSI (Dynamic System Initiative) March 2005

• A system model captures an entire system's composition in terms of all interrelated software and hardware components.

• A system model captures knowledge as prescriptive configurations and best practices, allowing the effects of changes to the system to be tested before the changes are implemented.

• Administrators do not need to operate directly on real-world systems but rather can model changes before committing to them. In this way, “what if” scenarios can be tried without impact to a business.

• A system model becomes the point of coordination and consistency across administrators who have separate but interdependent responsibilities.

System Definition Modelis a language, or a meta-model, that is used to create models of distributed systems. A distributed system is a set of related software or software and hardware resources running on one or more computers that are working together to accomplish a common function

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The notion of TS (Technology Space) as a tool for collaboration

• A Technology Space corresponds to:– A uniform representation system

• Syntactic trees • XML trees • Sowa graphs • UML graphs• MOF graphs• Categories• Graph Grammars

– A working context– A set of concepts– A shared knowledge and know

how– etc.

• It is usually related to a given community with an established expertise, know-how and research problems

• It has a set of associated tools and practices, etc.– Protégé, Rational Rose, …

CorbaC++

WWW

XMLdocumentware

etc.

RDBMS

Corba

Ontologies

Java

Graph Theory

MDAModelware

OOBMS

Linux

Description logic Prolog

Semantic WEB Grammarware

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Abstract Syntax Systems Compared

MOF

The UMLmeta-Model

A SpecificUML Model

A Specificphenomenon

corresponding toa UML Model

EBNF

Pascal LanguageGrammar

A specificPascal Program

A specificexecution

of a Pascal program

Technology #2(MOF + OCL)

M3

M2

M1

Technology #1(formal grammars

attribute grammars,etc.)

etc.

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

A technical space is organized around a set of conceptsTSpaces may be connected via bridgesTSpaces are often similarly organized

Program

Grammar

Data

Schema

Model

Meta-Model

Document

Schema

Ontology

Top Level O.

Syntax XML

MDA

DBMS Ontologyengineering

File

FileFormat

Drawing

Stencil

Model

Meta-Model

ToolFormat

Tool

Content

Form

FSMngt XML

MDA

Visio InfoPathBut also…

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Technical Spaces and Working Contexts

• Technical Spaces– Examples: MDE, MDA, MS/SF, EBNF, XML, DBMS, ontologies, etc. – Conjecture:

• Each TS is represented by a metametamodel • Each TS is organized in a 3 metalevel architecture

• Working contexts– Local

• MM specific – Global

• TS specific, MM independent – Universal

• Across several TSs (extended MIME notation)– Mof1.4/UML/mymodel– MicrosoftDSL/PetriNet/MyNet– ECORE/PetriNet/MyNet– EBNF/Pascal/MyProg– XML/MusicML/MyMusic– M3/M2/M1

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Models revisited

• Everything is a model– A -model meaning any specific TSpace– An XML document is an XML-model – A Java source program is a Java-model– An UML model is a MDA-model – etc.

• Each TSpace is rooted in a metametamodel (M3) defining a representation scheme and basic type system.

• Distinguish between intra-space and inter-space operations

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Model transformation across Technical Spaces

• There is a need for inter-TS model transformation.

A TS B TS

C TS D TS

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Agenda

Applicability

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Some examples of transformations

• Classical– UML2Java– UML2RDBMS

• But also tool to tool (more important)– UML Activity Diagrams to MS Project

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The KM3 metamodel (simplified)

+name : String

ModelElement

Package

+package 1

+contents

*

Classifier

DataType

+isAbstract : Boolean

Class

+supertypes

*

+lower : Integer+upper : Integer+isOrdered : Boolean+isUnique : Boolean

StructuralFeature

Attribute

+isContainer : Boolean

Reference

+opposite

0..1

+owner

1

+structuralFeatures

*

+type

1

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

KM3 definition of the KM3 metamodelpackage KM3 {

abstract class ModelElement extends LocatedElement { attribute name : String; reference "package" : Package oppositeOf contents; }

class Package extends ModelElement { reference contents[*] ordered container : ModelElement oppositeOf "package"; }

class Classifier extends ModelElement {}

class DataType extends Classifier {}

class Class extends Classifier { attribute isAbstract : Boolean; reference supertypes[*] : Class; reference structuralFeatures[*] ordered container : StructuralFeature

oppositeOf owner; }

-- continued on next slide

NOT XMI(Emfatic-like)

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Java to Excel Transformation (call graph)

FirstClass.java SecondClasss.java

public class FirstClass {public void fc_m1(){}public void fc_m2(){

this.fc_m1();this.fc_m1();

}}

public class SecondClass {public void sc_m1(){

FirstClass a = new FirstClass();

a.fc_m1();}public void sc_m2(){

this.sc_m1();}

}

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Java and Table Metamodels

JavaSource

+name

NamedElement

ClassDeclaration

MethodDefinition MethodInvocation

1

+classes*

0..1 +invocations *

+class0..1

+methods*

1

+method

*

Table

Row

+content

Cell

1

+rows*

1

+cells

*

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

UMLDI2SVG

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Tool Interoperability

• Tool interoperability

• Build a metamodel of each tool

• Write a transformation

• Two kinds of Metamodels

• Data stream oriented

• Event orientedAMMA

AMMA

ATLATL

AMWAMW

AM3AM3 ATP

ATP

Tool X Tool Y

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Agenda

Principles

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

What about the stability of MDA?

• Missing foundations may cause big problems ahead

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Just an academic issue anyway?

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Enter the "metamuddle"

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Model of a model

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The MDA metamuddle

• A very rapidly growing industrial application field since november 2000,

• … but …

• We badly need a unifying theory of models

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Credits and MDA compliance

Languageengineering

Ontologyengineering

MDE

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The "representation" relation

repOf

System and System elements Model and Model elements

Simple set interpretation of the repOf relationis probably as correct as simple set interpretationof the instanceOf relation in object technology.

?

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

the UML MetaModel

Class Attribute*

1

a UML Model

Client

Name : String

The "conformance" relation

M2

M1

the MOF

Class Association

source

destination

M3

c2

c2

c2

metameta meta

metameta

metamodel

model

"the real world"

meta-metamodel

The MOF

The UML metamodel

Some UML Models

Various usagesof these modelsM0

M1

M2

M3

meta

meta

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Summary: a Petri Net model

Metametamodel

Metamodel

Model

NodePlace

PlaceP1

PlaceP2

NodeTrans

NodeNode

NodeLink

LinkarcPT

LinkarcTP

TransT1

arcPT arcTP

LinkinCom

LinkoutGo

outGo

outGo

inCom

inCom

Linkmeta

outGo

inCom

inCom outGo

outGo inCom

conformsTo

conformsTo

conformsTo

meta

repOf

System

P2

P1

T1

Classicalrepresentation

M1

M2

M3

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

<petrinet> <place name=“P1”/> <place name=“P2”/> <transition name=“T1”/> <arcPT source=“P1” target=“T1”/> <arcTP source=“T1” target=“P2/></petrinet>

Metametamodel:XML Schema forXML Schema

Metamodel:a Petri NetXML Schema

Model: an XMLdocument

conformsTo

conformsTo

meta

repOf

System

…<xs:element name=“place"> <xs:complexType> <xs:attribute name=“name“ type=“xs:string"/> </xs:complexType> </xs:element>…

…<xs:element name=“element"> <xs:complexType> <xs:attribute name=“name“ type=“xs:string"/> … </xs:complexType> </xs:element>…

conformsTo

P2

P1

T1

Classicalrepresentation

M1

M2

M3

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Agenda

Deployment

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

AMMA: A Lightweight Architectural Style for for Generic Model Management Platforms

• ATLAS Model Management Architecture• Build around a minimal set of sound principles• Defines the conventions for the various connected tools to interoperate• Lightweight : Not reinventing CORBA (Model-based interoperability and not

Middelware-based interoperability)

• Four basic blocks:

AMMAAMMA

ATLATL AMWAMW AM3AM3 ATPATP

M. TransformationM. Composition

M. Global ManagementInter TSpaces Bridge

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Atlas Model Management Architecture

• Modeling in the small– Working at the level of model and metamodel elements

• Modeling in the large– Working with models and metamodels as global entities, for what

they represent, and their mutual relations, independently of their content

– A megamodel is a model which elements represents models, metamodels and other global entities (ako model registry with metadata on models and metamodels). A megamodel has a metamodel.

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

ATL: a model transformation language, engine and IDE

• ATL: a MOF/QVT like model transformation language

• For more info see: http://www.sciences.univ-nantes.fr/lina/atl/

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

G 2 P

RuleR 2 B

Rule

Model Transformation with ATL

Ma Mb

MMaGreen

Node

Red

Node

MMbBlue

Node

Pink

Node

Metametamodel

Node

Node

ATL

Rule

Node

MMa2MMb.atl

conformsTo conformsTo

conformsTo conformsTo

conformsTo

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

ATL editor (part of ATL Integrated Development Environment)

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

ATL Development Tools: source-level debugger

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The standard OMG model transformation language

ATL is a QVT-like language

If QVT is the solution,then what was the problem?

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

The Model Weaver: principles

OperationPort mapsTo OperationType

Left MM Weaving MM Right MM

Stub MM

Weaving model

extends

c2- Fixed mapping metamodelsare not sufficient

- We need support forextensible variable metamodels

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

• Model – set of elements and associations

• Associations (intra model relationships)

– Model Composition (inter model relationships)

Models

E1hasA

references

E2

E3

Model

E1 E2

E3

Model 1

E1 E2

Model 2

isA

E3 E4isA

E4

inherits Semantic defined in the metamodel

Undefined line semantics

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Metamodel extensions

• Several possible mapping DSLs (Domain Specific Languages)

• Adding extra semantics– Concatenation, foreign keys, nested, ordered, equals,

containment,supplier/consumer, etc.

E1

E2

E2

Model 1

E1 E2

Model 2

E3 E4

Equals

Concat

String

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

AMW example: RDBMS to XML

Semantics

SQL schema represented in Ecore

XML schema represented in Ecore

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Weaving metamodel Visualization (DSL tools and EMF)

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Weaving metamodel

• Minimal weaving metamodel– links and correspondences– extended to be used in different applications

-name : String-description : String

WElement

WModel-ref : StringWRef

WLinkEndWModelRef WElementRef

WLink

mod

el

ownedElement (1-*)

ownedElementRef(0-*)modelRef

end (1-*)

link

element

parent

child

(0-*

)

wovenModel (1-*)

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

AM3: ATLAS MegaModel Management Tool

• Megamodel: a model with elements corresponding to models, metamodels, services, tools and more generally to any global resource available in the scope of an AMMA session.

• A registry for model engineering resources as well as a metadata repository

• Megamodel with different metamodels

• Megamodels beyond typing systems

MM

M

typeOf

MM’versionOf

MM’

extensionOf

Tool

Service

implements

Parameter

typeOf

input

output

TM

output

intputetc.

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Representing zones with Megamodels

ZoneA

MegamodelMgA

repOf

MegamodelMetamodel

c2

ZoneB

MegamodelMgB

repOf

c2

FredATLNantes

IvanMistralEnschede

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Representing zones with Megamodels

ZoneA

MegamodelMgA

repOf

ZoneB

MegamodelMgB MgC

repOf

ZoneC

MegamodelMetamodel

c2 c2

ZoneBC

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Initial Metamodel Proposal for AMMA Megamodel Components

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Megamodel Resource Navigator for model components

• Technology Preview

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

ATP: TS and projectors

TSpace #1 MDA

TSpace #2 EBNF

TSpace #3 XML

TSpace #4 SQLπ1

π3

π2 JavaCorbaSVGNLP,etc.

XMIJMICMIetc.

model

mmodel

grammar

program

document

XMLschema

dataSchema

data

ATLASTechnicalProjectors

MS/OfficeSimulinkMatlabetc.

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Examples of projections from ME to XML and EBNF TSs

XML TS ME TS EBNF TS

MOF

MMa

Ma

EBNF

KM3.g

MMa.km3

XSD

MMa.xsd

Ma.xmi

XMI KM3

M3

M2

M1

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Conclusions

• Transformations are models• Weavings (correspondences) are models• Megamodels are models

• (meta-)Models everywhere– A file format– A tool internal data– A Visio stencil– An Infopath Form– An API– etc.

• Pragmatics of model transformation are important• EMF and MS/DSL may be considered as two TSpaces, based

on different M3

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Conclusions: AMMA on top of Eclipse and MS/DSL tools

Eclipse

EMF

AMMA

Visual Studio

Team System

AMMA

Eclipse

EMF

ATL IDE

ATL engine ATP

AM3 AMW

Eclipse

EMF

ATL IDE

ATL engineATL engine ATPATP

AM3 AMWATL MTF

KM3 Emfatic

etc. etc.

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

How adaptable is MDA?

• MDA™ already evolved a lot in the last five years.• MDA will have to evolve much more rapidly in the near future

if OMG wants to meet the real needs of the user community.• Strong competition will be coming from other technical

spaces like XML, Microsoft DSLs, EMF, etc.• End users are no more accepting huge, approximatively

defined and committee-driven standards; they are asking for an available, adapted and agile set of small standards similar to XML.

• If MDA does not evolve rapidly, it will become one small niche in the MDE landscape; it will be quoted as the first historical one; many competing families of model engineering technologies will emerge and develop.

• What is important is assessing the basic principles of MDE; The decisions of OMG, W3C, OASIS, Microsoft, IBM and others on how to map these principles on implementation frameworks (e.g. Java, C#, XML, etc.) or on paper recommendations is only the responsibility of these organizations; the end user will be the final judge.

©2005 ATLAS NantesHow Adaptable is MDA? CTIT Symposium, University of Twente

Thanks

Questions?Comments?

http://www.sciences.univ-nantes.fr/lina/atl/