CSSE 490 Model-Based Engineering: Introduction to MetaModels

Shawn Bohner Office: Moench Room F212 Phone: (812) 877-8685 Email: [email protected]

Learning Outcomes: Metamodels

Design a metamodel for a model-based software system.

 Discuss Metamodel paper  Outline OMG Metamodel  Examine key elements of MetaObject Facility (MOF)  Discuss limitations of MOF

Q3 Paper Discussion: Metamodel Paper

Model-Driven Development: A Metamodeling Foundation

 What are the main thrusts of the paper?  What are the controversial points and your positions?  What did you get out of reading about feature-based transformation approaches? “Model” is to “Metamodel” as ______is/are to ______?

 Again, think for 15 seconds…  Turn to a neighbor and discuss it for a minute Cougaar Model Driven Architecture

Computation Domain Workflow Application Independent Model General Domain Application Model (GDAM)

Platform General Cougaar Application Independent Model (GCAM) Model

Cougaar Architecture Components Platform Specific Java Development Environment Model Meta-Model

 Must first curse to recurse 0-L …and we did! GDAM Component

1-N 1-N 1-N GCAM GCAM GCAM Component Component Component

1-R 1-R 1-R

JET Template JET Template JET Template

CMDA UML and the OMG 4 Layer Metamodel

M3 MOF

corresponds to

M2 UML metamodel UML diagrams based on

corresponds to

is modeled using M1 User model (UML)

corresponds to

M0 Real world So, How do we define an Object?

Reality M0 Layer Set: Employees of company A emp # Name

class 0800101 Fred Flintstone

0800102 Barny Rubble

object instance 0800103 Dino Flintstone

Class Emp={ people | people working for company A} Object Concept and Metamodel

M1 Layer M2 Layer

Class Class emp Class name emp#: aribute name:

enrollment() operaon Aribute Operaon M3 Layer

ModelElement

Feature * Classifier

Aribute Operaon Interface Class Meta-Layers

 Mn+1 defines the structure of Mn MOF Meta-meta-model  But, Mn+1 is not an abstraction of Mn UML UMLUML Meta-model  Meta-layer relationships Modèle are similar to grammar- FacePampletModèle layer relationships Model  E.g., BNF, or XML Schema Getting a bit of keyboard time…. Could we create a new UML? Metamodel Architecture Example Meta-metamodeling ! abstract language MOF standard MetaClass, ! specific paradigm (OO paradigm) MetaAttribute, (e.g., OO) M3 … ! application independent MetaOperation

Metamodeling Class, ! abstract language USPM UML Attribute, ! specific paradigm (e.g., OO) (RUP) metamodel … ! application specific M2 metamodel standard Operation, ! process or notation modeling, etc. Component

Modeling stockShare, ! concrete language RUP UML … ! specific paradigm (e.g., OO) M1 model standard owner, ! specific model ! describes the data needed askPrice

Information GartnerShare99, Project X Project X ! applied in "real world" … ! specific paradigm (e.g., OO) M0 Process Artifacts Bohner, ! specific project standard 61.12

Attribute Meta-Meta-Model +name +multiplicity 1

*  MetaObject Facility Parameter (MOF) defines the +direction +type Type * language for defining 1*

meta-models Operation -name 1  MOF concepts 1 Package * Class DataType +import 0..1  meta-class, +name +name 1 *  meta-attribute, * +super  meta-association, * 1 -type * 1 etc. String Integer Boolean

*  Meta-meta-model *

Association AssociationEnd is self defined +name +name +multiplicity 1 2 What is MOF?

 MetaObject Facility (MOF) is OMG's adopted technology for defining and representing it as objects using UML

 A MOF metamodel defines the abstract syntax of the metadata representation of a model  Describes an abstract syntax for representing a model which describes an object concept - called “the MOF model”  MOF is situated at the M3 (Meta-Meta) layer

Source: Colin Aktinson, Essence of Multilevel Metamodeling (UML2001) MOF Metamodel Architecture

Type

Instance Type

Instance

Source: Colin Aktinson, Essence of Multilevel Metamodeling (UML2001) Key MOF /Depends on Model Element Abstractions

 Element Contains  Namespace Namespace  Generalizable Element

Generalizes Generalizable Element

Typed Classifier Element Feature in MOF Model Element

Feature

Every class has Aributes and Operaons as Feature MOF Model Elements for Typed Element

Classifier typed by TypedElement is a Class, Associaon, or Data Type MOF Model Elements for Data Type MOF Model Elements for Association

Associaon between classes Multilevel Metamodel Challenges

 Diversity of “Meta concept”

 “Ambiguous Classification”

 “Replication of Concept”

 Shallow Instantiation

 Deep Instantiation

Source: Colin Aktinson, Essence of Multilevel Metamodeling (UML2001) Diversity of Meta Concept

Type Type Description Template

Category or Apply/ Instantiation Grouping Describe Stereotype

Instances Sub type Anything Realization

Base model Abstract Syntax

Base-variant Expression

Customized Expression

Source: Colin Aktinson, Essence of Multilevel Metamodeling (UML2001) Ambiguous Classification: Replication of Concept

A particular instance “Fido” Class

Pet Dog

Animal

Instance

Instance of Instance

Source: Colin Aktinson, Essence of Multilevel Metamodeling (UML2001) Shallow and Deep Instantiation Shallow Instanaon Deep Instanaon M3 Meta- Meta Object Concept Object Concept Model Mechanism Mechanism instanate instanate

M2 Meta Object Concept Concept Object Concept Object Concept

M1 Model Object Object Object Object Object property property property property property

instanate M0 Instances Instances Instances Instances

Source: Colin Aktinson, Essence of Multilevel Metamodeling (UML2001) Homework and Milestone Reminders

 Bring Laptop on Thursday for Plus/Delta

 Read DSL Survey Paper entitled, “When and How to Develop Domain-Specific Languages” by Mernik et al.  Be prepared to discuss and even lead the discussion  Write a brief summary of observations on the paper

 Milestone 2: Establish a repository and structure for assembling components for your FacePamphlet application  Due by 11:55pm Friday, April 1st, 2011 (no foolin’!)