• Keine Ergebnisse gefunden

The UML 2.0 meta model

N/A
N/A
Protected

Academic year: 2022

Aktie "The UML 2.0 meta model"

Copied!
92
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Software Engineering I:

Software Technology

WS 2008/09

The UML 2.0 meta model

Prof. Bernd Bruegge, Ph.D.

Florian Schneider

Applied Software Engineering Technische Universitaet Muenchen

© 2008 Bernd Brügge So0ware Engineering I: So0ware  1

Technology WS 2008/09

(2)

Outline for today

• From model instances to meta models

• MOF meta model hierarchy

• How UML relates to MOF

– Example: Use case diagram meta model – Example: Class diagram meta model

• Different notaOons for the UML meta model  describe the same language

• UML Profiles: Adding new members to the family

© 2008 Bernd Brügge So0ware Engineering I: So0ware  2

Technology WS 2008/09

(3)

From model instances to meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(4)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(5)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(6)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(7)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

aPerson is an instance of the class Person.

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(8)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

aPerson is an instance of the class Person.

Thus the class Person is a model for aPerson.

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(9)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

aPerson is an instance of the class Person.

Thus the class Person is a model for aPerson.

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(10)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

aPerson is an instance of the class Person.

Thus the class Person is a model for aPerson.

• Can we generalize this relaOonship?

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(11)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

aPerson is an instance of the class Person.

Thus the class Person is a model for aPerson.

• Can we generalize this relaOonship?

  What is the model for the class Person?

© 2008 Bernd Brügge So0ware Engineering I: So0ware  3

Technology WS 2008/09

(12)

From model instances to meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  4

Technology WS 2008/09

(13)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  4

Technology WS 2008/09

(14)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  4

Technology WS 2008/09

(15)

From model instances to meta models

• Canonical model‐instance‐relaOonship:

– The instance aPerson and the class Person are on  different levels of abstracOon

– The class Person specifies features that characterize  the structure and behavior of Persons

 The model for the class Person must characterize the  structure and behavior of classes

© 2008 Bernd Brügge So0ware Engineering I: So0ware  4

Technology WS 2008/09

(16)

From model instances to meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  5

Technology WS 2008/09

(17)

From model instances to meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  5

Technology WS 2008/09

(18)

From model instances to meta models

• RelaOonship between model and meta‐model:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  5

Technology WS 2008/09

(19)

From model instances to meta models

• RelaOonship between model and meta‐model:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  5

Technology WS 2008/09

(20)

From model instances to meta models

• RelaOonship between model and meta‐model:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  5

Technology WS 2008/09

(21)

From model instances to meta models

• RelaOonship between model and meta‐model:

– The meta class Class is a model for the class  Person

© 2008 Bernd Brügge So0ware Engineering I: So0ware  5

Technology WS 2008/09

(22)

From model instances to meta models

• RelaOonship between model and meta‐model:

– The meta class Class is a model for the class  Person

– Since Person is a model (for the instance aPerson),  Class is a meta model (model for models)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  5

Technology WS 2008/09

(23)

From model instances to meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  6

Technology WS 2008/09

(24)

From model instances to meta models

At first this might be confusing, so:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  6

Technology WS 2008/09

(25)

From model instances to meta models

At first this might be confusing, so:

– Think of the different layers of abstracOon:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  6

Technology WS 2008/09

(26)

From model instances to meta models

At first this might be confusing, so:

– Think of the different layers of abstracOon:

• Instances are concrete

© 2008 Bernd Brügge So0ware Engineering I: So0ware  6

Technology WS 2008/09

(27)

From model instances to meta models

At first this might be confusing, so:

– Think of the different layers of abstracOon:

• Instances are concrete

• Models are an abstract descripOon of the instances

© 2008 Bernd Brügge So0ware Engineering I: So0ware  6

Technology WS 2008/09

(28)

From model instances to meta models

At first this might be confusing, so:

– Think of the different layers of abstracOon:

• Instances are concrete

• Models are an abstract descripOon of the instances

• Meta models are an abstract descripOon of models

• …

© 2008 Bernd Brügge So0ware Engineering I: So0ware  6

Technology WS 2008/09

(29)

Meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  7

Technology WS 2008/09

(30)

Meta models

Why do we need them?

© 2008 Bernd Brügge So0ware Engineering I: So0ware  7

Technology WS 2008/09

(31)

Meta models

Why do we need them?

• Meta models can be used for instance to formalize  UML notaOons:

© 2008 Bernd Brügge So0ware Engineering I: So0ware  7

Technology WS 2008/09

(32)

Meta models

Why do we need them?

• Meta models can be used for instance to formalize  UML notaOons:

• The UML is a Language, meta models are used to describe  the grammar

© 2008 Bernd Brügge So0ware Engineering I: So0ware  7

Technology WS 2008/09

(33)

Meta models

Why do we need them?

• Meta models can be used for instance to formalize  UML notaOons:

• The UML is a Language, meta models are used to describe  the grammar

• The UML meta model describes all models one can create  using UML

© 2008 Bernd Brügge So0ware Engineering I: So0ware  7

Technology WS 2008/09

(34)

Meta models

Why do we need them?

• Meta models can be used for instance to formalize  UML notaOons:

• The UML is a Language, meta models are used to describe  the grammar

• The UML meta model describes all models one can create  using UML

• The meta model allows to talk about semanOcs

© 2008 Bernd Brügge So0ware Engineering I: So0ware  7

Technology WS 2008/09

(35)

Meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  8

Technology WS 2008/09

(36)

Meta models

OK, so meta models are cool, but how do I  create a meta model?

© 2008 Bernd Brügge So0ware Engineering I: So0ware  8

Technology WS 2008/09

(37)

Meta models

OK, so meta models are cool, but how do I  create a meta model?

To approach this problem, we will look at the  history of UML’s meta model first.

© 2008 Bernd Brügge So0ware Engineering I: So0ware  8

Technology WS 2008/09

(38)

The history of UML’s meta model

© 2008 Bernd Brügge So0ware Engineering I: So0ware  9

Technology WS 2008/09

(39)

The history of UML’s meta model

• First there was UML which had semanOc  problems

© 2008 Bernd Brügge So0ware Engineering I: So0ware  9

Technology WS 2008/09

(40)

The history of UML’s meta model

• First there was UML which had semanOc  problems

• The OMG tried to formalize meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  9

Technology WS 2008/09

(41)

The history of UML’s meta model

• First there was UML which had semanOc  problems

• The OMG tried to formalize meta models

• They realized that all they needed to describe  meta models was a subset of UML class 

diagram elements

© 2008 Bernd Brügge So0ware Engineering I: So0ware  9

Technology WS 2008/09

(42)

The history of UML’s meta model

• First there was UML which had semanOc  problems

• The OMG tried to formalize meta models

• They realized that all they needed to describe  meta models was a subset of UML class 

diagram elements

  To describe any meta model, we can use the  UML class diagram notaOon!

© 2008 Bernd Brügge So0ware Engineering I: So0ware  9

Technology WS 2008/09

(43)

Meta Object Facility (MOF)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  10

Technology WS 2008/09

(44)

Meta Object Facility (MOF)

• The OMG introduced the MOF to create a  common approach to meta modeling

© 2008 Bernd Brügge So0ware Engineering I: So0ware  10

Technology WS 2008/09

(45)

Meta Object Facility (MOF)

• The OMG introduced the MOF to create a  common approach to meta modeling

• A meta model which is defined using MOF is  called “MOF compliant”

© 2008 Bernd Brügge So0ware Engineering I: So0ware  10

Technology WS 2008/09

(46)

Advantages of MOF compliant meta  models

• They can easily be compared

• Their instances (models) can be exchanged in  a standardized way (XML Metadata 

Interchange)

• Their instances can live in the same metadata  repository (data warehousing)

© 2008 Bernd Brügge So0ware Engineering I: So0ware 

Technology WS 2008/09 11

(47)

Meta Object Facility (MOF) ‐ Facts

© 2008 Bernd Brügge So0ware Engineering I: So0ware  12

Technology WS 2008/09

(48)

Meta Object Facility (MOF) ‐ Facts

In general, the sequence

instance    model    meta model    meta‐meta model   … 

could be conOnued infinitely.

© 2008 Bernd Brügge So0ware Engineering I: So0ware  12

Technology WS 2008/09

(49)

Meta Object Facility (MOF) ‐ Facts

In general, the sequence

instance    model    meta model    meta‐meta model   … 

could be conOnued infinitely.

• MOF defines a four‐layer meta model hierarchy

• four layers suffice for most pracOcal applicaOons

• MOF and UML are aligned

• UML infrastructure contains concepts for UML and  MOF

© 2008 Bernd Brügge So0ware Engineering I: So0ware  12

Technology WS 2008/09

(50)

Meta model hierarchy of the MOF (UML‐specific)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  13

Technology WS 2008/09

(51)

Meta model hierarchy of the MOF (UML‐specific)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  14

Technology WS 2008/09

(52)

Meta model hierarchy of the MOF (UML‐specific)

UML meta model (Layer M2)

•  defines concepts like classes, a8ributes and associa;ons

© 2008 Bernd Brügge So0ware Engineering I: So0ware  14

Technology WS 2008/09

(53)

Meta model hierarchy of the MOF (UML‐specific)

UML meta model (Layer M2)

•  defines concepts like classes, a8ributes and associa;ons

•  model of the language UML

© 2008 Bernd Brügge So0ware Engineering I: So0ware  14

Technology WS 2008/09

(54)

Meta model hierarchy of the MOF (UML‐specific)

UML meta model (Layer M2)

•  defines concepts like classes, a8ributes and associa;ons

•  model of the language UML

  Layer M2 contains descripOons of the elements that  can be used to describe the models on the model layer

© 2008 Bernd Brügge So0ware Engineering I: So0ware  14

Technology WS 2008/09

(55)

Meta model hierarchy of the MOF (UML‐specific)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  15

Technology WS 2008/09

(56)

Meta model hierarchy of the MOF (UML‐specific)

UML‐model (Layer M1)

By using any UML diagram, we instanOate the UML  meta model and obtain a UML model

© 2008 Bernd Brügge So0ware Engineering I: So0ware  15

Technology WS 2008/09

(57)

Meta model hierarchy of the MOF (UML‐specific)

UML‐model (Layer M1)

By using any UML diagram, we instanOate the UML  meta model and obtain a UML model

 Layer M1 contains applica;on‐specific models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  15

Technology WS 2008/09

(58)

Meta model hierarchy of the MOF (UML‐specific)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  16

Technology WS 2008/09

(59)

Meta model hierarchy of the MOF (UML‐specific)

Instances (Layer M0)

• Real instances of the models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  16

Technology WS 2008/09

(60)

Meta model hierarchy of the MOF (UML‐specific)

Instances (Layer M0)

• Real instances of the models

Layer M0 contains concrete run‐;me instances

© 2008 Bernd Brügge So0ware Engineering I: So0ware  16

Technology WS 2008/09

(61)

Meta model hierarchy of the MOF (UML‐specific)

Instances (Layer M0)

• Real instances of the models

Layer M0 contains concrete run‐;me instances

• Note the difference between instance specifica;ons  and real instances!

© 2008 Bernd Brügge So0ware Engineering I: So0ware  16

Technology WS 2008/09

(62)

Meta model hierarchy of the MOF (UML‐specific)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  17

Technology WS 2008/09

(63)

Meta model hierarchy of the MOF (UML‐specific)

MOF model (Layer M3)

•  The UML meta model is an instance of a yet more  abstract model, namely the MOF model

© 2008 Bernd Brügge So0ware Engineering I: So0ware  17

Technology WS 2008/09

(64)

Meta model hierarchy of the MOF (UML‐specific)

MOF model (Layer M3)

•  The UML meta model is an instance of a yet more  abstract model, namely the MOF model

•  M3 : M2 ≈ M2 : M1

© 2008 Bernd Brügge So0ware Engineering I: So0ware  17

Technology WS 2008/09

(65)

Meta model hierarchy of the MOF (UML‐specific)

MOF model (Layer M3)

•  The UML meta model is an instance of a yet more  abstract model, namely the MOF model

•  M3 : M2 ≈ M2 : M1

  Layer M3 contains meta‐meta models

© 2008 Bernd Brügge So0ware Engineering I: So0ware  17

Technology WS 2008/09

(66)

Meta model hierarchy of the MOF (UML‐specific)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  18

Technology WS 2008/09

(67)

Meta model hierarchy of the MOF (UML‐specific)

Remember that this is only an example!

•  We looked at a UML‐specific hierarchy

© 2008 Bernd Brügge So0ware Engineering I: So0ware  18

Technology WS 2008/09

(68)

Meta model hierarchy of the MOF (UML‐specific)

Remember that this is only an example!

•  We looked at a UML‐specific hierarchy

•  MOF describes meta models in general

© 2008 Bernd Brügge So0ware Engineering I: So0ware  18

Technology WS 2008/09

(69)

Where are we?

 From model instances to meta models

 MOF meta model hierarchy

 How UML relates to MOF

– Example: Use case diagram meta model – Example: Class diagram meta model

• Different notaOons for the UML meta model  describe the same language

• UML Profiles: Adding new members to the family

© 2008 Bernd Brügge So0ware Engineering I: So0ware  19

Technology WS 2008/09

(70)

How UML relates to MOF

© 2008 Bernd Brügge So0ware Engineering I: So0ware  20

Technology WS 2008/09

(71)

How UML relates to MOF

• UML is MOF‐compliant:

The UML meta model is an instance of the MOF  model

© 2008 Bernd Brügge So0ware Engineering I: So0ware  20

Technology WS 2008/09

(72)

How UML relates to MOF

• UML is MOF‐compliant:

The UML meta model is an instance of the MOF  model

• Let’s see the UML meta model in acOon!

© 2008 Bernd Brügge So0ware Engineering I: So0ware  20

Technology WS 2008/09

(73)

Use Case Diagram Meta Model  (simplified)

*

*

* 1

*

1 1 1

* *

* 1

* 1..*

0..1 0..1

© 2008 Bernd Brügge So0ware Engineering I: So0ware  21

Technology WS 2008/09

(74)

Use Case Diagram Meta Model  (simplified)

*

<<instanceOf>>

*

* 1

*

1 1 1

* *

* 1

* 1..*

0..1 0..1

© 2008 Bernd Brügge So0ware Engineering I: So0ware  21

Technology WS 2008/09

(75)

Use Case Diagram Meta Model  (simplified)

*

<<instanceOf>>

*

* 1

*

1 1 1

* *

* 1

* 1..*

0..1 0..1

© 2008 Bernd Brügge So0ware Engineering I: So0ware  21

Technology WS 2008/09

(76)

Use Case Diagram Meta Model  (simplified)

*

<<instanceOf>>

*

* 1

*

1 1 1

* *

* 1

* 1..*

0..1 0..1

© 2008 Bernd Brügge So0ware Engineering I: So0ware  21

Technology WS 2008/09

(77)

Use Case Diagram Meta Model  (simplified)

*

<<Extend>>

<<instanceOf>>

*

* 1

*

1 1 1

* *

* 1

* 1..*

0..1 0..1

© 2008 Bernd Brügge So0ware Engineering I: So0ware  21

Technology WS 2008/09

(78)

Use Case Diagram Meta Model  (simplified)

*

<<Extend>>

<<Include>>

<<instanceOf>>

*

* 1

*

1 1 1

* *

* 1

* 1..*

0..1 0..1

© 2008 Bernd Brügge So0ware Engineering I: So0ware  21

Technology WS 2008/09

(79)

Class Diagram Meta Model (simplified)

0..1

*

0..1 *

0..1

*

0..1 2..*

© 2008 Bernd Brügge So0ware Engineering I: So0ware  22

Technology WS 2008/09

(80)

Class Diagram Meta Model (simplified)

<<instanceOf>>

0..1

*

0..1 *

0..1

*

0..1 2..*

© 2008 Bernd Brügge So0ware Engineering I: So0ware  22

Technology WS 2008/09

(81)

Class Diagram Meta Model (simplified)

<<instanceOf>>

0..1

*

0..1 *

0..1

*

0..1 2..*

© 2008 Bernd Brügge So0ware Engineering I: So0ware  22

Technology WS 2008/09

(82)

Class Diagram Meta Model (simplified)

<<instanceOf>>

0..1

*

0..1 *

0..1

*

0..1 2..*

© 2008 Bernd Brügge So0ware Engineering I: So0ware  22

Technology WS 2008/09

(83)

Class Diagram Meta Model (simplified)

<<instanceOf>>

0..1

*

0..1 *

0..1

*

0..1 2..*

© 2008 Bernd Brügge So0ware Engineering I: So0ware  22

Technology WS 2008/09

(84)

Where are we?

 From model instances to meta models

 MOF meta model hierarchy

 How UML relates to MOF

 Example: Use case diagram meta model

 Example: Class diagram meta model

 Different notaOons for the UML meta model  describe the same language

• UML Profiles: Adding new members to the family

© 2008 Bernd Brügge So0ware Engineering I: So0ware  23

Technology WS 2008/09

(85)

NotaOons for the UML meta model

• The UML meta model defines a language for  specifying UML models 

• The notaOon used to depict UML models  provides graphical constructs represenOng  instances of meta model elements

(SOcky figure represents an Actor)

•  The notaOon is a funcOon from meta model  elements to model elements

(“uml‐nota;on(Actor) =       “)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  24

Technology WS 2008/09

(86)

Where are we?

 From model instances to meta models

 MOF meta model hierarchy

 How UML relates to MOF

 Example: Use case diagram meta model

 Example: Class diagram meta model

 Different notaOons for the UML meta model  describe the same language

 UML Profiles: Adding new members to the family

© 2008 Bernd Brügge So0ware Engineering I: So0ware  25

Technology WS 2008/09

(87)

UML Profiles

• consist of stereotypes, tagged values and  constraints

• customize UML models for parOcular domains  or platorms

• are applied to elements of the UML meta  model (M2)!

• are developed by manufacturers or 

standardizaOon organizaOons (CORBA, .NET)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  26

Technology WS 2008/09

(88)

Applying UML Profiles

• By applying a UML profile,

• you apply stereotypes to meta classes

• you provide a deeper meaning for the model

• the model gains integrity

• you narrow the amount of valid models, as you  can see on the following slide…

© 2008 Bernd Brügge So0ware Engineering I: So0ware  27

Technology WS 2008/09

(89)

UML Profiles

All models (MOF) UML models

CORBA  models (profile)

SysML models

.NET models (profile)

© 2008 Bernd Brügge So0ware Engineering I: So0ware  28

Technology WS 2008/09

(90)

Further reading

• MOF specificaOon 

– URL to be delivered through the exercise portal

• Again, the UML 2 specificaOon

– See UML 2 Slides

© 2008 Bernd Brügge So0ware Engineering I: So0ware 

Technology WS 2008/09 29

(91)

OrganizaOonal Mauers 1

• Mid term exam

– Thursday, December 18 th  17:30 – Room to be announced

– RegistraOon procedure to be announced

© 2008 Bernd Brügge So0ware Engineering I: So0ware 

Technology WS 2008/09 30

(92)

OrganizaOonal Mauers 2 "

• For those of you interested in doing the 

homework, please read through the exercise  sheet

– QuesOons?

– Please deliver the soluOon on Thursday, October  30 th

• Paper based: before the exercise

• E‐Mail based: send e‐mail to Florian Schneider, same  deadline

© 2008 Bernd Brügge So0ware Engineering I: So0ware 

Technology WS 2008/09 31

Referenzen

ÄHNLICHE DOKUMENTE

Operations on software engineering databases then amount to graph operations, which can involve documents, versions, configurations, or an entire database..

Question 2.3: Analysis of the Project Risks (11 points, approx. 8 minutes working time) In this task, you analyze potential risks of the project &#34;Development of a clock

Software Engineering !Einleitung zur Vorlesung !© 2013 Martin Glinz und Thomas

•  die bestehende Software an veränderte Bedürfnisse oder Umweltbedingungen anzupassen!. •  oder die bestehende Software um neue Fähigkeiten

Schließlich sollen Gesundheitskarte und elektronische Datennetze auch dabei helfen, Kosten einzusparen, die im Gesundheitswesen entstehen, weil Verwal- tungsvorgänge durch die

❍   Beim Prüfen erkannte Fehler müssen anschließend korrigiert werden (indem die verursachenden Defekte erkannt und behoben werden)!... Software

●  Entwicklungsteam schätzt Aufwand pro Position und wählt Positionen für anstehende Iteration aus (scrum backlog)!. ❍   Durchführung

●  Wie soll das Risiko im Projekt verfolgt werden?. ●  Kann das Risiko auf Dritte