Download presentation
Presentation is loading. Please wait.
Published byAyden Pape Modified over 9 years ago
1
SEG4110 – Advanced Software Design and Reengineering TOPIC D Metamodelling
2
SEG4110 - Topic D - Metamodelling2 What is a Meta-metamodel? A metamodel describes information about models A meta-metamodel describes information about metamodels Metamodels that are defined using the same meta- metamodel -Can exchange information -Can be used by the same CASE tools that understand the meta-metamodel
3
SEG4110 - Topic D - Metamodelling3 What is MOF? MOF stands for Meta Object Facility enables meta-metamodeling of UML level metamodels It defines a small set of concepts (such as package, class, method, attribute…) that -allow one to define and manipulate models of metadata (data about data) -are described using a subset UML notation
4
SEG4110 - Topic D - Metamodelling4 OMG 4-Layer Architecture
5
SEG4110 - Topic D - Metamodelling5 OMG 4-Layer Architecture (Cont.)
6
SEG4110 - Topic D - Metamodelling6 MOF Model
7
SEG4110 - Topic D - Metamodelling7 MOF Key Abstract Classes
8
SEG4110 - Topic D - Metamodelling8 MOF Key Abstract Classes (Cont.) ModelElement common base Class of all M3-level Classes. Every ModelElement has a name Namespace base Class for all M3-level Classes that need to act as containers GeneralizableElement base Class for all M3-level Classes that support generalization (i.e. inheritance) TypedElement base Class for M3-level Classes such as Attribute, Parameter, and Constant whose definition requires a type specification Classifier base Class for all M3-level Classes that (notionally) define types. Examples of Classifier include Class and DataType
9
SEG4110 - Topic D - Metamodelling9 The MOF Model: Main Concrete Classes The key concrete classes (or meta-metaclasses) of MOF are as follows: -Class -Association -Exception (for defining abnormal behaviours) -Attribute -Constant -Constraint
10
SEG4110 - Topic D - Metamodelling10 The MOF Model: Key associations Contains: relates a ModelElement to the Namespace that contains it Generalizes: relates a GeneralizableElement to its ancestors (superclass and subclass) IsOfType: relates a TypedElement to the Classifier that defines its type -An object is an instance of a class DependsOn : relates a ModelElement to others that its definition depends on -E.g. a package depends on another package
11
SEG4110 - Topic D - Metamodelling11 UML Meta Model Metaclasses used in class, package, component and deployment diagrams
12
SEG4110 - Topic D - Metamodelling12 Model Elements An element is an atomic constituent of a model. Element is the top metaclass in the metaclass hierarchy A model element is a named entity in a Model It is the base for all modeling metaclasses in UML -All other modeling metaclasses are either direct or indirect subclasses of ModelElement ModelElement name Element
13
SEG4110 - Topic D - Metamodelling13 owner {ordered} Method body Operation isAbstract Attribute initialValue specification ***** * Feature visibility BehaviouralFeature StructuralFeature multiplicity Classifier * Features Feature is an abstract class that declares a behavioral or structural property of -an instance of a Classifier -the Classifier itself A behavioral feature refers to a dynamic feature of a model element -E.g. operation or method A structural feature refers to a static feature of a model element -E.g. attribute
14
SEG4110 - Topic D - Metamodelling14 A classifier is an element that describes behavioral and structural features -E.g. class, data type, interface, component Classifier is an abstract class that -declares a collection of Features, such as Attributes, Methods… -has a name, which is unique in the Namespace enclosing the Classifier Classifier Component Structure 1..* EnumerationLiteral ProgrammingLanguageTypeEnumerationPrimitive Subsystem DataType Interface deploymmentLocation * resident * ClassNode Classifier {ordered} Feature visibility * Namespace
15
SEG4110 - Topic D - Metamodelling15 Classifier (cont.) * 1..* * Object Parameter defaultValue kind Instance GeneralizableElement isRoot isLeaf isAbstract owner {ordered} participant * specification * AssociationEnd isNavigable aggregation multiplicity * type Feature visibility Classifier * type Namespace A classifier defines a namespace and is a generalizable element Can have -association ends -parameters -instances
16
SEG4110 - Topic D - Metamodelling16 AssociationClass Class Association Generalization discriminator Relationship Relationships A relationship is a connection among model elements UML defines several relationships such as: -Association -Generalization UML defines other types of relationships that are not shown in this diagram, such as: -Dependency -Flow
17
SEG4110 - Topic D - Metamodelling17 Namespace 0..1 ownedElement Namespace GeneralizableElement isRoot isLeaf isAbstract Package Model Subsystem Classifier ModelElement name * importedElement * * A namespace is a part of a model that contains a set of other model elements -E.g. Associations and Classifiers -the name of an owned model element is unique within the namespace Namespace is an abstract metaclass and it subclasses are -Classifier -Package
18
SEG4110 - Topic D - Metamodelling18 Data Types 1..* EnumerationLiteral ProgrammingLanguageTypeEnumeration Primitive DataType UML Data types include -primitive built-in types (such as integer and string) -definable enumeration types (such as Boolean whose literals are false and true) Programming languages data types -are specified according to the semantics of a particular programming language -are not portable among languages (except by agreement among the languages) -do not map into other UML classifiers Enumerations are a user-defined data types whose instances are literals (specified by the user)
19
SEG4110 - Topic D - Metamodelling19 Mapping of UML Models to Metamodel Elements (Example) CustomerAccount accountNumber balance overdraftLimit CreditCard expiryDate * 1..2 withdraw deposit SavingChequing BankSystem Generalization discriminator Relationship Association Relationship AssociationEnd isNavigable aggregation multiplicity Class Classifier Namespace Package Attribute initialValue StructuralFeature multiplicity Method BehaviouralFeature
20
SEG4110 - Topic D - Metamodelling20 Use Case Diagrams Metamodel
21
SEG4110 - Topic D - Metamodelling21 Mapping Use Cases Model to Metamodel Generalization discriminator Relationship Include Relationship Actor Classifier UseCase Classifier Extend Relationship Open file by typing name Open file by browsing Open file System Administrator Browse for file Ordinary User Attempt to open file that does not exist «extend» «include»
22
SEG4110 - Topic D - Metamodelling22 State Machines (Main Metamodel)
23
SEG4110 - Topic D - Metamodelling23 Mapping State Machines to Metamodel SimpleState State PseudoState StateVertex Event Transition 0..1 * Enter / run motor forwards Enter / run motor in reverse Enter / stop motor Enter / stop motor openingCompleted closingCompleted pressButton Closing Open OpeningClosed Procedure State 0..1+entry 0..1
24
SEG4110 - Topic D - Metamodelling24 Extension Mechanisms Metamodel
25
SEG4110 - Topic D - Metamodelling25 Example LinearShape startPoint: Point 1..* edge LineSegment Path LinePolygon RegularPolygon endPoint: Point {startPoint <> endPoint} {ordered} {edge->size=1} {edge->forAll(e1,e2 | e1.length = e2.length)} length : int length {length = edge.length->sum} {edge->first.startPoint = edge->last.endPoint} Stereotype GeneralizableElement Constraint
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.