bridging microsoft oslo and eclipse emf -...

17
Bridging Microsoft Oslo and Eclipse EMF Seminar Modellgetriebene Softwareentwicklung Abschlusspräsentation Stanley Hillner

Upload: others

Post on 25-Mar-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Bridging Microsoft Oslo and Eclipse EMF

Seminar Modellgetriebene SoftwareentwicklungAbschlusspräsentation

Stanley Hillner

Page 2: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Microsoft Codename „Oslo“

Microsofts neuestes Werkzeug für MDSD Heißt jetzt „MS SQL Server Modeling Services“

3 wesentliche BestandteileOslo Modeling Language „M“Oslo Repository „Quadrant“

Oslo verfolgt typische Ziele des MDSDModelle nehmen im gesamten SW-Lebenszyklus zentrale Rolle einSteigerung der ProduktivitätSteigerung der SW-Qualität

Direkte Anbindung an .NET Plattform

http://www.integration-engineering.de2

Page 3: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Microsoft Codename „Oslo“ – „M“

Generische Modellierungssprache (3 Bestandteile)MSchema: Definition von Datenschemata (Metamodelle)MGraph: Definition von Dateninstanzen (Modelle)MGrammar: Definition von Grammatiken für textuelle DSLs

Oslo stellt auch Editor für „M“ zur Verfügung („Intellipad“)Modellierung aller drei SprachbestandteileVerschiedene Sichten auf die Schemata, Modelle, Grammatiken,

usw.

Beispiel für Modellierung in „M“ unter Nutzung von „Intellipad“Musikbibliothek

Alben Künstler Bewertungen

http://www.integration-engineering.de3

Page 4: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Microsoft Codename „Oslo“ – MSchema

Definition des Schemas (Bibliothek, Alben, Interpreten, Ratings)

http://www.integration-engineering.de4

module Oslo.EMF.Sample{

type MusicItem{

Id : Integer64 => AutoNumber();Album : Text;Artist : Text;Rating : Integer32 where value <= 3;

} where identity Id;

MusicLibrary : MusicItem*;}

Page 5: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Microsoft Codename „Oslo“ – MGraph

Definition von Dateninstanzen (konform zum Schema)

http://www.integration-engineering.de5

module Oslo.EMF.Sample{

MusicLibrary{

{Album => "...Baby One More Time",Artist => "Britney Spears",Rating => 3

},{

Album => "Leave Britney Alone",Artist => "Chris Crocker",Rating => 1

}}

}

Page 6: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Microsoft Codename „Oslo“ – MGrammar

Definition einer Grammatik für eine DSL Akzeptiert Statements der Form „AlbumName“ by „ArtistName“ is „Ranking“ „.“|„!“

http://www.integration-engineering.de6

module Oslo.EMF.Sample{

import Language;language MusicLibraryLanguage{

syntax Main = s:Statement+ => MusicLibrary{valuesof(s)};syntax Statement = al:Grammar.TextLiteral "by„ ar:Grammar.TextLiteral

"is" rt:Rating ("." | "!") => {Album{al}, Artist{ar},Rating{rt}};

token Rating1 = "terrible" | "awful";token Rating2 = "so so";token Rating3 = "awesome";

syntax Rating = Rating1 =>1 | Rating2 =>2 | Rating3 =>3;interleave skippable = Base.Whitespace;

}}

Page 7: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Microsoft Codename „Oslo“ – Modellierungsprozess

http://www.integration-engineering.de7

Metadata, Data

derive

transform

OPC image

MG Execution Tool

M Compiler M Execution Tool

RepositoryData definition

Grammar definition

DSL Datadefinition

Schema definition

Page 8: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Microsoft Codename „Oslo“ – Quadrant

http://www.integration-engineering.de8

Page 9: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Eclipse Modeling Framework

Open-Source Java-Framework zur Erstellung von Anwendungen Arbeitet mit strukturierten Modellen

Wesentliche BestandteileEMF Core Ecore als Metametamodell (MOF-Implementierung)EMF.Edit Erstellung von Editoren für MetamodelleEMF.Codegen Generierung von Code für (Meta)Modelle

EMF ist leicht und schnell zu erlernenTrotzdem sehr mächtig

Große Akzeptanz und Verbreitung Ist Open-SourceVielzahl an Werkzeugen vorhanden, für Aufgaben des MDSD

http://www.integration-engineering.de9

Page 10: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Eclipse Modeling Framework – Komponenten

EMF CoreEcore als Metametamodell Implementiert MOF-Spezifikation der OMGAufbau siehe Diagramm

EMF.EditErstellung von Editoren (auf Basis von Metamodellen)Nutzt generische Klassen (LabelProvider, ContentProvider)Nutzung von Standard Jface Viewern

EMF.CodegenGenerierung der Klassenstruktur aus dem MetamodellGenerierung der Objekte aus dem ModellNutzt Genmodel und Java Development Tooling (JDT)

http://www.integration-engineering.de10

*eSuperTypes

EDataType EAttribute

EClass

containment : Boolean

EReference

EStructuralFeature

nsURI : StringnsPrefix : String

EPackage

name : String

ENamedElement

EModelElement EObject

lowerBound : IntegerupperBount : Integer

ETypedElement

*eClassifiers

*

eSubPackages

*

eStructuralFeatures

eAttributeType

eReferenceType

EClassifier

Page 11: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Eclipse Modeling Framework – (Meta)Modellierung

Erstellung eines Metamodells (konform zu Ecore)Nutzung des Ecore model editor, graphisch, aus XSD, Rose-Modell

Erzeugung eines Genmodels aus dem Metamodell

Generierung der Klassenstruktur Generierung eines Standard-Editors Generierung von Testcode

Erstellung von Modellen in generiertem Editor Oder mit dynamischer Instanz des Metamodells Oder dynamisch per Quellcode (EMF Reflection API)

Erzeugung einer DSL z.B. durch Grammatik in XText

http://www.integration-engineering.de11

grammar oslo.emf.musiclibrary.Dsl with org.eclipse.xtext.common.Terminalsimport "platform:/resource/Oslo-EMF/model/MusicLibrary.ecore„

MusicLibrary : (MusicItems+=MusicItem)*;

MusicItem : Album = STRING "by" Artist=STRING "is" Rating=Rating ("!"|".");

enum Rating : terrible|awful="1" |so_so="2“|awesome="3";

Page 12: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Mögliche Vorteile einer Oslo-EMF Brücke

EMF ist bereits Hub für Bridging von MDSD ToolsBereits viele Brücken vorhanden (Visio, Aris, MetaEdit, DSL Tools,

GME, usw.)Verwendung existierender Brücken zur Verringerung des

Aufwandes (transitive Brücken)Dadurch höhere Effizienz und Qualität

Bereitstellung von FunktionalitätEMF ist Open-Source große Community Viele ToolsPassendes Werkzeug für (fast) jede AufgabeOslo hat auch Vorzüge (Repository, Quadrant)

Wechsel ermöglichenEMFOsloOsloEMF

http://www.integration-engineering.de12

Page 13: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Das M3-level based Bridging pattern

Setzt Vorhandensein einer Metamodell-Hierarchie voraus

Mapping auf M3-Ebene Konstrukte des einen auf Konstrukte des anderen Werkzeugraums

abbilden Transformation auf M2-Ebene Basiert auf Abbildung der M3-Ebenen Erstellung von Metamodellen für anderes Tool und die

Metamodelle in diesem Tool Transformation auf M1-Ebene Konkrete Instanzen (Modelle) werden abhängig vom Metamodell

transformiert

Problem: Metamodelle bzw. Modelle in generischem Format

http://www.integration-engineering.de13

MMM

MM1

M1 M2

MM2

M3 M4

conform to

conform to

MMM’

MM1’

M1’ M2’

MM2’

M3’ M4’

conform to

conform to

M3

M2

M1

Mapping

Transformation

Transformation

Page 14: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Bridging-Ansatz (M3B)

http://www.integration-engineering.de14

Instance of

transformation

conform to

MSchema

conform to

Ecore

conform to

Model

conform to

determines

O3

Model

MSchema

Meta Model

Schema

M3-level mapping

transformation

transformation

M3

M2

M1

Oslo EMF

MGraph

determines

Instance of

Schema

Page 15: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Bridging-Ansatz (M2B)

http://www.integration-engineering.de15

Instance of

MSchema

conform to

Ecore

conform to

Model

conform to

determines

O3

Model transformation

transformation

M3

M2

M1

Oslo EMF

MGraph

determines

Instance of

SchemaMeta Model

Schema

conform to

Page 16: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Bridging-Ansatz (Vertikale Transformationen)

http://www.integration-engineering.de16

Instance of MSchema

conform to

Ecore

Model

conform to

determines

Model

transformation

M3

M2

M1

Oslo EMF

MGraph

determines

Instance of

Schema

conform to

Schema

conform totransformation

transformation

transformation

conform to

MSchema MGraph

O3

Page 17: Bridging Microsoft Oslo and Eclipse EMF - uni-leipzig.debis.informatik.uni-leipzig.de/de/Lehre/0910/WS/LV/MDSD/... · 2010-01-29 · Microsoft Codename „Oslo“ Microsofts neuestes

Fragen?

http://www.integration-engineering.de17