Advanced Topics in Software Engineering (02265) Ekkart Kindler

Similar documents
Model-based Software Engineering (02341, spring 2016) Ekkart Kindler

Model-based Software Engineering (02341, spring 2017) Ekkart Kindler

Model-based Software Engineering (02341, spring 2017) Ekkart Kindler

Metamodeling. 16. April 2012 Real-Time Systems Lab Prof. Dr. Andy Schürr Dr. Gergely Varró 1

MOF and XMI. (version 2.0) by Philippe Nguyen March 24, 2005

Attributes and Associations of Class Property

Metamodeling with Metamodels. Using. UML/MOF including OCL

CISC836: Models in Software Development: Methods, Techniques and Tools

An introduction to MOF MetaObject Facility.

Advanced Topics in Software Engineering (02265) Ekkart Kindler

MODEL DRIVEN ARCHITECTURE (MDA)

02291: System Integration

Model Driven Development Unified Modeling Language (UML)

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

Weaving Executability into Object-Oriented Meta-Languages

Coral: A Metamodel Kernel for Transformation Engines

Model-Level Integration of the OCL Standard Library Using a Pivot Model with Generics Support

ATL Transformation. Catalogue of Model Transformations

Introduction to XML Metadata Interchange (XMI)

ATL Transformation. Catalogue of Model Transformations

Better Metadata Management through Better Metamodels

SERG. An Extensive Catalog of Operators for the Coupled Evolution of Metamodels and Models

ATL TRANSFORMATION EXAMPLE

Second OMG Workshop on Web Services Modeling. Easy Development of Scalable Web Services Based on Model-Driven Process Management

XML Metadata Interchange (XMI)

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

OCL omissions and contradictions

A THREAD-SAFE IMPLEMENTATION OF A META-PROGRAMMABLE DATA MODEL. Daniel Balasubramanian. Thesis. Submitted to the Faculty of the

Advanced Topics in Software Engineering (02265) Ekkart Kindler

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

The Eclipse Modeling Framework and MDA Status and Opportunities

ATL Transformation Examples. The KM3 to Metric ATL transformation

MDT OCL Goes Generic. Introduction to OCL and Study of the Generic Metamodel and API. Christian W. Damus IBM Rational Software OCL Committer

Dominique Blouin Etienne Borde

Object-Oriented Analysis and Design. Pre-UML Situation. The Unified Modeling Language. Unification Efforts

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Directives for Composing Aspect-Oriented Design Class Models

Ákos Horváth Gábor Bergmann Dániel Varró István Ráth Model Driven Software Development Lecture 3

UML Class Diagrams 2. Martin Nečaský Dept. of Software Engineering Faculty of Mathematics and Physics Charles University in Prague

Model-Independent Differences

Language engineering and Domain Specific Languages

Computation Independent Model (CIM): Platform Independent Model (PIM): Platform Specific Model (PSM): Implementation Specific Model (ISM):

Model Driven Engineering with Ontology Technologies

METADATA INTERCHANGE IN SERVICE BASED ARCHITECTURE

Outline. A little history. Outline. The Unified Modeling Language Opportunities and Challenges for Formal Methods

Model-based Software Engineering (02341, Spring 2017) Ekkart Kindler

The MEMO Meta Modelling Language (MML) and Language Architecture

Model Driven Ontology: A New Methodology for Ontology Development

Plan. Language engineering and Domain Specific Languages. Language designer defines syntax. How to define language

Horváth Ákos Bergmann Gábor Dániel Varró István Ráth

On Implementing MOF 2.0 New Features for Modelling Language Abstractions

Model-Driven Engineering (MDE) Lecture 1: Metamodels and Xtext Regina Hebig, Thorsten Berger

WHY WE NEED AN XML STANDARD FOR REPRESENTING BUSINESS RULES. Introduction. Production rules. Christian de Sainte Marie ILOG

Model-based Software Engineering (02341, spring 2017) Ekkart Kindler

OMG Unified Modeling Language TM (OMG UML), Infrastructure

Technische Universität Dresden

UML 2.5: Specification Simplification

The packages that are explicitly merged from the InfrastructureLibrary are the following: PrimitiveTypes Constructs

administrivia today UML start design patterns Tuesday, September 28, 2010

Reconciling TGGs with QVT

An Ontological Analysis of Metamodeling Languages

Defining Domain-Specific Modeling Languages

An introduction to MDR : The Model Driven approach

Comparing Relational Model Transformation Technologies Implementing QVT with Triple Graph Grammars

ATL Transformation. Catalogue of Model Transformations

Dominique Blouin Etienne Borde

TOPCASED. Toolkit In OPen source for Critical Applications & SystEms Development

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Advanced Topics in Software Engineering (02265) Ekkart Kindler

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

Rich Hilliard 20 February 2011

Kent Academic Repository

Business Activity. predecessor Activity Description. from * successor * to. Performer is performer has attribute.

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Metamodeling and Metaprogramming

Metamodeling and Metaprogramming

Lecture 22: Meta-Modelling

Model Composition - A Signature-Based Approach

ETSI STANDARD Methods for Testing and Specification (MTS); The Test Description Language (TDL); Part 3: Exchange Format

Grammars. Prof. Andreas Prinz. Introduction, Compilers. Examples Meta-models vs. Grammars Summary

Using UML To Define XML Document Types

Technical Solutions for the Transformation-Driven Graphical Tool Building Platform METAclipse

Capturing Middleware using UML Models.

Softwaretechnik Model Driven Architecture Meta Modeling

UML big picture. Perdita Stevens. School of Informatics University of Edinburgh

Semantic Web Domain Knowledge Representation Using Software Engineering Modeling Technique

Spemmet - A Tool for Modeling Software Processes with SPEM

Object-Oriented Software Engineering Practical Software Development using UML and Java

Design and Prototypical Implementation of a Pivot Model as Exchange Format for Models and Metamodels in a QVT/OCL Development Environment

UML 2 SEMANTICS AND APPLICATIONS

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Working Paper The MEMO meta modelling language (MML) and language architecture. 2nd Edition

UML PROFILING AND DSL

CWM: Model Driven Architecture

OMG Modeling Glossary B

Model Driven Architecture - The Vision

Workpackage 15: DBE Business Modeling Language. Deliverable D15.5: BML Editor Final Release

Proceedings of the Workshop on OCL and Textual Modelling (OCL 2011)

UML 2.0 Infrastructure Specification

A universal PNML Tool. Lukasz Zoglowek

Transcription:

Advanced Topics in Software Engineering (02265)

III. Meta-modelling 2

1. Background / Motivation Mid / end 90ties: CASE (Computer Aided Software Engineering) modelling tools become more popular code generation and round-trip-engineering UML-like notations (and others Booch, OMG ) many dialects, variations, extensions Though UML starts prevailing, many other notations are in use (today called Domain Specific Languages/DSLs) Different ways in which code is generated Tools programmed manually Tools, models, generated code,... incompatible Hinder industrial success 3

Approaches Standardisation of a single notation: UML Standardisation of a transfer format Still many problems with exchanging models Need for other modeling notations Observation: Basic infrastructure for any CASE tool is independent from the modeling notation CASE tools should be implemented using their technology 4

Outset M2 Unified Modelling Notation modelling notation M1 Model design-time M0 User data run-time 5

Re: Example (from L01) ClassDiagram PetriNet * Class 1 start 1 end * Association * Object Node 1 source 1 target Arc :Class :Association :Association :Class Transition Place * Token :Petrinet :Transition source :Arc target :Place target source :Arc :Arc :Token :Place source target :Arc source target :Transition 6

Outset ClassDiagram M2 Unified Modelling Notation * Class 1 start 1 end * Association PetriNet * M1 Model Object Node 1 source Arc 1 target Transition Place * Token M0 User data = conforms to / is instance of 7

Meta Object Facility (MOF) M3 MOF notation meta-modelling notation M2 Any modelling notation modelling notation M1 Model design-time M0 User data run-time = conforms to / is instance of 8

Discussion Is that any good? There is one level that we did not have before! So, this seems to be more complicated! If UML can be defined in terms of itself, why should we define it in terms of something else? 9

3. The Meta Object Facility M3 MOF notation M2 Any modelling notation M1 Model M0 User data = conforms to / is instance of 10

Meaning of Meta- Meta (from Greek: μετά = "after", "beyond", "with", "adjacent", "self"), is a prefix used in English in order to indicate a concept which is an abstraction from another concept, used to complete or add to the latter. In epistemology, the prefix meta- is used to mean about (its own category). For example, metadata are data about data, something about something (who has produced them, when, what format the data are in and so on). Similarly, metamemory in psychology means an individual's knowledge about whether or not they would remember something if they concentrated on recalling it. Furthermore, metaemotion in psychology means an individual's emotion about his/her own basic emotion, or somebody else's basic emotion. Another, slightly different interpretation of this term is "about" but not "on" (exactly its own category). For example, in linguistics a grammar is considered as being expressed in a metalanguage, or a sort of language for describing another language (and not itself). A meta-answer is not a real answer but a reply, such as: "this is not a good question", "I suggest you ask your professor". Here, we have such concepts as meta-reasoning and metaknowledge. From: http://en.wikipedia.org/wiki/meta 11

Meaning of meta Co-notations and meaning in Software Engineering: beyond, one level higher possibly self-referential (with all the problems of self-referentiality) Often also: a UML model a class diagram 12

3.1. EMOF model EMOF Types Element 0..1 NamedElement name: String [0..1] annotatedelement 0..* ownedcomment 0..* Comment body: String TypedElement type 0..1 Type 13

EMOF Classes Type TypedElement MultiplicityElement isordered: Boolean = false isunique: Boolean = true lower: Integer = 1 upper: UnlimitedNatural = 1 Class isabstract: Boolean = false class ownedattribute 0..1 {ordered} 0..* 0..* Property isreadonly: Boolean = false default: String [0..1] iscomposite: Boolean = false isderived: Boolean = false isid: Boolean 0..1 opposite superclass class ownedoperation Operation 0..1 {ordered} 0..* 14

EMOF Classes (cntd.) Additional constraints (e.g.): opposite properties are properly paired no cycles in inheritance structure an object can be contained in at most one container 15

EMOF Classes (cntd.) TypedElement MultiplicityElement TypedElement MultiplicityElement Operation operation ownedparameter {ordered} 0..* Parameter 0..1 0..* 0..* raisedexception Type Constraint: raisedexception must actually be Class 16

EMOF Data Types Type NamedElement DataType PrimitiveType Enumeration enumeration ownedliteral 0..1 {ordered} 0..* Enumeration Literal 17

EMOF Primitive Types Boolean String Integer UnlimitedNatural (* for infinity ) 18

EMOF Packages NamedElement Package uri: String package ownedtype 0..1 0..* nestingpackage Type 0..1 0..* nestedpackage 19

EMOF Discussion Can EMOF be defined with its own concepts? Is it expessible enough? What is missing (as compared to UML diagrams)? How does EMOF relate to ECore (the model underlying EMF)? Can UML be expressed in it? Any other problems? 20

3.2 Reflection capability Creating models and their instances (resp. metamodels and their conforming models) dynamically Navigating between model elements and instance By navigation between different meta-levels in an arbitrary way, MOF is not restricted to a fixed number of levels. 21

Reflection package Object Element getmetaclass():class container():element equals(el:object):boolean 0..1 get(prop:property):object set(prop:property,val:object) isset(prop:property):boolean unset(prop:property) Type isinstance(o:object):boolean Package 1 package NamedElement Factory createfromstring(d:datatype,s:string):object converttostring(d:datatype,o:object):string create(mc:class):element For properties with more than one value, there exist ReflexiveCollection and ReflexiveSequence (similar to Java Collections)! 22

3.3 Complete MOF As discussed, EMOF lacks some features: Associations (only by paired properties, and only binary) Visibilities Subsetting and redefing properties... In the following, we indicate how some of these features are captured in CMOF Like EMOF, CMOF can be defined in terms of its own concepts (or in terms of EMOF) 23

UML Core::Constructs 24

UML Core::Constructs 25

CMOF Reflection similar to EMOF (a bit more complex) explicit creation of Links (see next slides) invocation of operations instanceof can check class hierarchy (instance of subclasses) 26

Abstract Semantics Semantic domain model introduces the concepts for the instances of a model and how the reflection capabilities behave on the model 27

CMOF instance model 28

4. XMI Mapping MOF-models and its instances to XML in a standard way A MOF model is mapped to an XMLSchema for its instances XMI is a standard associated with MOF =>You can easily exchange MOF models =>Once you agree on the MOF-model, you can exchange instances of that model 29

Example: EMOF model <?xml version="1.0" encoding="utf-8"?> <emof:package xmi:version="2.0" xmlns:xmi="http://www.omg.org/xmi" xmlns:emof="http://schema.omg.org/spec/mof/2.0/emof.xml" xmi:id="petrinets" name="petrinets" uri="apetrineteditorin15minutes"> <ownedtype xmi:type="emof:class" xmi:id="petrinets.petrinet" name="petrinet"> <ownedattribute xmi:id="petrinets.petrinet.object" name="object" isordered="true" lower="0" upper="*" type="petrinets.object" iscomposite="true"/> </ownedtype> <ownedtype xmi:type="emof:class" xmi:id="petrinets.object" name="object" isabstract="true"/> <ownedtype xmi:type="emof:class" xmi:id="petrinets.node" name="node" isabstract="true superclass="petrinets.object"> <ownedattribute xmi:id="petrinets.node.name" name="name" isordered="true" lower="0"> <type xmi:type="emof:primitivetype" href="http://schema.omg.org/spec/mof/2.0/emof.xml#string"/> </ownedattribute> <ownedattribute xmi:id="petrinets.node.in" name="in" isordered="true" lower="0" upper="*" type="petrinets.arc" opposite="petrinets.arc.target"/> <ownedattribute xmi:id="petrinets.node.out" name="out" isordered="true" lower="0" upper="*" type="petrinets.arc" opposite="petrinets.arc.source"/> </ownedtype> 30

Example (cntd.) <ownedtype xmi:type="emof:class" xmi:id="petrinets.arc" name="arc" superclass="petrinets.object"> <ownedattribute xmi:id="petrinets.arc.source" name="source" isordered="true" type="petrinets.node" opposite="petrinets.node.out"/> <ownedattribute xmi:id="petrinets.arc.target" name="target" isordered="true" type="petrinets.node" opposite="petrinets.node.in"/> </ownedtype> <ownedtype xmi:type="emof:class" xmi:id="petrinets.transition" name="transition" superclass="petrinets.node"/> <ownedtype xmi:type="emof:class" xmi:id="petrinets.place" name="place" superclass="petrinets.node"> <ownedattribute xmi:id="petrinets.place.token" name="token" isordered="true" lower="0" upper="* type="petrinets.token" iscomposite="true"/> </ownedtype> <ownedtype xmi:type="emof:class" xmi:id="petrinets.token" name="token"/> <xmi:extension extender="http://www.eclipse.org/emf/2002/ecore"> <nsprefix>apetrineteditorin15minutes</nsprefix> </xmi:extension> </emof:package> 31

XMI instance <?xml version="1.0" encoding="utf-8"?> <APetriNetEditorIn15Minutes:PetriNet xmi:version="2.0" xmlns:xmi="http://www.omg.org/xmi" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:apetrineteditorin15minutes="apetrineteditorin15minutes"> <object xsi:type="apetrineteditorin15minutes:transition" name="t1" in="//@object.7" out="//@object.4"/> <object xsi:type="apetrineteditorin15minutes:transition" name="t2" in="//@object.5" out="//@object.6"/> <object xsi:type="apetrineteditorin15minutes:place" name="p1" in="//@object.6" out="//@object.7"> <token/> </object> <object xsi:type="apetrineteditorin15minutes:place" name="p2" in="//@object.4" out="//@object.5"/> <object xsi:type="apetrineteditorin15minutes:arc" source="//@object.0" target="//@object.3"/> <object xsi:type="apetrineteditorin15minutes:arc" source="//@object.3" target="//@object.1"/> <object xsi:type="apetrineteditorin15minutes:arc" source="//@object.1" target="//@object.2"/> <object xsi:type="apetrineteditorin15minutes:arc" source="//@object.2" target="//@object.0"/> </APetriNetEditorIn15Minutes:PetriNet> 32

5. MOF to Java MOF models can also be mapped to a programming language with an API The Java Metadata Interface (JMI) is a standard mapping to Java The mapping of EMF models to Java is another one (not compatible with JMI) 33

6. Summary M3 EMOF? CMOF M2 Any modelling notation M1 Model M0 User data = conforms to / is instance of 34

Discussion Why EMOF and CMOF? Relation between UML infrastructure and MOF Relation between EMOF and ECore (EMF) 35

Relation to SE2 M3 ECore M2 epnk / SE2 CASE Tool M1 Model M0 User data = conforms to / is instance of 36

Overview See: http://www2.imm.dtu.dk/~pk/images/meta-levels.pdf (thanks to Patrick) 37