Docsity

Basic UML Class Diagram Notation, Slides of Computer Aided Design (CAD)

Toggle sidebar
bg1
Name
{Abstract}
Abstract class
Aggregation and Composition (has-a) relationship
Base
Derived1 Derived2
Inheritance (is-a) relationship
Derived2 is-a Base
Part
Whole
Whole has Part as a part;
lifetimes might be different;
Part might be shared with other
Wholes.
(aggregation)
Association (uses, interacts-with) relationship
A B
A’s role B’s role
Multiplicity in Aggregation, Composition, or Association
* - any number 0..1 - zero or one
1 - exactly 1 1..* - 1 or more
n
- exactly nn .. m - n through m
Follow line from start class to end class,
note the multiplicity at the end.
Say “Each <start> is associated with <multiplicity> <ends>”
A B
1*
Each A is associated with any number of B’s.
Each B is associated with exactly one A.
Whole has Part as a part;
lifetime of Part controlled by Whole,
Part objects are contained in one
Whole object.
(composition)
Part
Whole
Object
classname: objectname
Basic UML Class Diagram Notation
Navigability - can reach
B starting from A
A B
Class
Name
attributes
(member variables)
methods
(member functions)
+ public_method()
# protected_method()
- private_method()
N
am
e
v
irtual method
()
method()
pf2

Partial preview of the text

Download Basic UML Class Diagram Notation and more Slides Computer Aided Design (CAD) in PDF only on Docsity!

Name

{Abstract}

Abstract class

Aggregation and Composition (has-a) relationship

Base

Derived1 Derived

Inheritance (is-a) relationship

Derived2 is-a Base

Part

Whole

Whole has Part as a part; lifetimes might be different; Part might be shared with other Wholes. (aggregation)

Association (uses, interacts-with) relationship

A B

A’s role (^) B’s role

Multiplicity in Aggregation, Composition, or Association

    • any number 0..1 - zero or one 1 - exactly 1 1..* - 1 or more n - exactly n n .. m - n through m

Follow line from start class to end class, note the multiplicity at the end. Say “Each is associated with ”

A B

Each A is associated with any number of B’s. Each B is associated with exactly one A.

Whole has Part as a part; lifetime of Part controlled by Whole, Part objects are contained in one Whole object.

Part (composition)

Whole

Object

classname: objectname

Basic UML Class Diagram Notation

Navigability - can reach B starting from A

A B

Class

Name

attributes

(member variables)

methods

(member functions)

  • public_method()

protected_method()

  • private_method()

Name

virtual method()

method()

object sends message to itself (one method calls another)

message sent (function call)

information returned (non-void return)

<>

<>

object1 focus of control

lifetime

return with no information (void return) - use for clarity only

object

object

<>

get_info(spec)

requested info

do_something()

<>

search-self

void return is implicit

Basic UML Sequence Diagram Notation

time flow

objects

one that starts the action at the left