17
Metamodeling Lab (Advanced Software Engineering course) a.y. 2014/2015 Luca Berardinelli Post Doc @ DISIM University of L’Aquila

Metamodeling - Advanced Software Engineering Course 2014/2015

Embed Size (px)

DESCRIPTION

Slides of the Metamodeling Lab for the Advanced Software Engineering Course 2014/2015 at DISIM, University of L'Aquila

Citation preview

Page 1: Metamodeling - Advanced Software Engineering Course 2014/2015

Metamodeling Lab

(Advanced Software Engineering course)a.y. 2014/2015

Luca BerardinelliPost Doc @ DISIM

University of L’Aquila

Page 2: Metamodeling - Advanced Software Engineering Course 2014/2015

Copyright Notice

The material in these slides may be freely reproduced and distributed, partially or totally, as far as an explicit reference or acknowledge to the material author is preserved.

Page 3: Metamodeling - Advanced Software Engineering Course 2014/2015

Lecturer

Page 4: Metamodeling - Advanced Software Engineering Course 2014/2015

What does “modeling” stand for?

"Modeling, in the broadest sense, is the cost-effective use of something in place of something else for some cognitive purpose. It is simpler, safer or cheaper than reality”. 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.

Page 5: Metamodeling - Advanced Software Engineering Course 2014/2015

Is Cristoforo Colombo a modeler?Sailors have drawn maps to travel around the world. Cognitive purpose: e.g., to support commercial/military activities

Sailor

map(s)<<creates>><<read by>>

SailorREALITY(world)

<<represented by>>

<<specified in>>

language?

language?

<<specified in>>

<<defines>>you

today

Page 6: Metamodeling - Advanced Software Engineering Course 2014/2015

Is Cristoforo Colombo a modeler?Sailors have drawn maps to travel around the world. Cognitive purpose: e.g., to support commercial/military activities

map(s)

REALITY(world)

<<represented by>>

<<specified in>>

language?

language?

<<specified in>>

M0

M1

M2

M3

Page 7: Metamodeling - Advanced Software Engineering Course 2014/2015

Maps today: from M0 to M3

M0 : <Data,Reality>

M1 : <Model>

M2 : <MetaModel>

M3 : <MetaMetaModel>

Page 8: Metamodeling - Advanced Software Engineering Course 2014/2015

The right answers

M0 : It is under your feet!

M1 : The map itself except...

M2 : The legend list that provides decoding info, the concepts to build model)

M3 : It is not on the map. It provides the concepts to define different legends (M2)

Page 9: Metamodeling - Advanced Software Engineering Course 2014/2015

A Model-Driven Software Process

Reqs Specs Design Implementation Deployment Runtime

Problem domain Solution domain (sw)

MMMMMMMM

MMMM MM

MMMM MM

MMMM MM

MMMM

< abstraction gap >

Different artifacts (e.g., models) can be created during the development process.

These artifacts may be used for communication purposes among stakeholders (architects, designers, programmers...)In MDE, these artifacts must be machine readable!

Page 10: Metamodeling - Advanced Software Engineering Course 2014/2015

New Domain: Software EngineeringWhich language(s)? Do we need new, domain specific languages? How do we create new languages?

DesignerDesigner,Programmer,....

REALITY(software system)

<<specified in>>

language?

language(s)?

<<specified in>>

<<defines>>you

today

<<represented by>>

Page 11: Metamodeling - Advanced Software Engineering Course 2014/2015

New Domain: Software EngineeringWhich language(s)? Do we need new, domain specific languages? How do we create new languages?

DesignerDesigner,Programmer,....

REALITY(software system)

<<specified in>>

EBNF

Java

<<specified in>>

<<defines>>you

today

<<represented by>>

http://cs.fit.edu/~ryan/cse4251/mini_java_grammar.html

Page 12: Metamodeling - Advanced Software Engineering Course 2014/2015

New Domain: Software EngineeringWhich language(s)? Do we need new, domain specific languages? How do we create new languages?

DesignerDesigner,Programmer,....

REALITY(software system)

<<specified in>>

Ecore

MyLanguage

<<specified in>>

<<defines>>you

today

<<represented by>>

Modeling Framework(EMF)

Rich Client Platform(RCP)

Page 13: Metamodeling - Advanced Software Engineering Course 2014/2015

Digital Library System

We want to build a distributed software system for managing a Digital Library. The customers can access the digital edition (e.g. PDF or PS file format) from a client application. On the server side, the system stores the description of the documents (its name, type, authors…). The librarian, properly logged within the system as “librarian” can add, modify, or delete the documents….The distributed system can be implemented using JAVA based technologies …[…]

Reqs Specs

Page 14: Metamodeling - Advanced Software Engineering Course 2014/2015

DesignLibrary Metamodel (M2)

We define a very simple “domain-specific” language for modeling libraries. We use Ecore provided by Eclipse EMF.

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.emf.doc/tutorials/clibmod/clibmod.html

You can use any editor capable to “save” this artifact “as” *.ecore

LIBRARY Metamodel(Ecore)

Page 15: Metamodeling - Advanced Software Engineering Course 2014/2015

Library Model Editor (M1)

http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.emf.doc/tutorials/clibmod/clibmod.html

Conforms to

Library Editor(Eclipse RCP App)

We implement an Editor to realize Library Models using Eclipse RCP plugin.

Design

Page 16: Metamodeling - Advanced Software Engineering Course 2014/2015

My Library Model (M1): serialization

<?xml version="1.0" encoding="UTF-8"?><Library:Library xmlns:Library="http://Library" xmlns:_="" name="Luca's Library"> <writers _:books="#//@books.1" name="Luca Berardinelli"/> <writers _:books="#//@books.0" name="Unknown"/> <books writers="#//@writers.1" title="Alone in The Dark" pages="123"/> <books writers="#//@writers.0" title="My Life" pages="400" category="Bibiography"/></Library:Library>

An modeler is able to structure and store information about a specific domain in a machine-readable way, so that software can “reason” about such a domain.

Page 17: Metamodeling - Advanced Software Engineering Course 2014/2015

A real library (M0)