1 uml basics by ronald koster ()

9
1 UML Basics by Ronald Koster (http://www.ronaldkoster.net)

Upload: hugh-thomas

Post on 31-Dec-2015

218 views

Category:

Documents


0 download

TRANSCRIPT

1

UML Basics

by Ronald Koster (http://www.ronaldkoster.net)

2

UML BasicsMyClassName

Any rectangle is a class

Special classes

<<actor>>=def

<<boundary>>=def

<<control>>=def

<<entity>> =def

<<component>> =def

<<package>> =def

<<subsystem>> =def <<subsystem>>

<<interface>> =def

<<subsystem>><<database>> =def

3

UML Basics

Associations

A B Association: A and B have some sort of relation.

A B Directed Association: A can find B (A has a B).

A B Dependence: A depends on B. NB.: =def <<depends-on>>

A B Extension: A extends B (A is a B). NB.: =def <<extends>>

A B Realization: A realizes (=implements) B (A is a B). NB.:

=def <<realizes>>

A B Aggregation: A is an aggregation of Bs, ie. A supersetOf {B} *. NB.:

=def <<is-an-aggregation-of>>

A B Composition: A is a composition of Bs, ie. A = {B} *. NB.:

=def <<is-a-composition-of>>

*: {B} =def {X | X instanceOf B} =def setOf(B)

4

UML Basics

Isomorfisms 1/2

B

A

B

<<interface>>A

<==>def

Lollypop style

BA <==>def BA

5

UML Basics

Isomorfisms 2/2

UC xxx

UC yyy

MySystem

UC xxx

UC yyyUser User

<==>def

Catalysis style (superior)Use Case Diagram style

MySystem

A

B

C

MySystem

A B C

<==>def

MySystem

6

UML Basics

Duck on Skies: any (sub)system is an aggregation of Analysis Classes.

User

MySystem

7

<<layer>>Service

UML Basics

Duck on Skies and software layers.

<<subsystem>>Database

<<layer>>Presentation

<<layer>>Access

<<model>> Domain

<<subsystem>> MySystem

User

<<subsystem>>OtherSystem1

<<subsystem>>OtherSystem2

8

UML Basics

Conventions

• Class name: noun, starts with a capital letter.• Method name: verb, starts with a lower case letter.• Instance name: noun, starts with a lower case letter.• Variable name: = Instance name.

Definitions

• Object =def Instance of a class.

someName: MyClass Named instance ofclass MyClass

: MyClass

Anonymous instanceof class MyClass

9

UML Basics

Further readings

Superb Modelling Method from Catalysis:

• http://www.catalysis.org/books/ocf/ch01.pdf (see also http://www.catalysis.org/books/ocf/index.htm)

UML Reference Guides:

• http://sparxsystems.com.au/resources/uml2_tutorial• http://www.holub.com/goodies/uml