Jump into Release 1

Class Diagram UML Annotations
• Example: http://www.mathcs.gordon.edu/courses/cps211/ATMExamp
le/ClassDiagram.html
• Diamond
• Big Open Triangle
• Small Arrow
• Dotted line
• http://www.uml-diagrams.org/classreference.html
ATM – check Bjork’s design
Class diagram Annotations
Diamond
Diamond attached to the class that contains
another class.
Often read as “has a “ from the diamond side to
the non-diamond, and “is part of” from the nondiamond to the diamond.
Filled diamond means the part cannot exist
without the container. If the container is deleted,
delete the parts.
Chapter 7 Design and implementation
2
ATM – check Bjork’s design –
more annotations
Class diagram Annotations
Triangle
Triangle attached to the whole in an “is a “
relationship.
The class not touching the triangle “is a “ the class
touching the triangle.
The class touching the triangle “can be a “ the
class not touching the triangle (“but it will not
always be one”)
Chapter 7 Design and implementation
3
ATM – check Bjork’s design –
more annotations
Class diagram Annotations
Small arrow
Two classes are related, but only one knows the
relationship exists
The class without the arrow knows the one with
the arrow exists
Solid line – the arrow side is contained inside the
other side
Dotted line – just has a weak relationship with
(maybe creates it during a method)
Chapter 7 Design and implementation
4
ATM – check Bjork’s design –
more annotations
Class diagram Annotations
Dotted line - association
To small arrow – depends on the small arrow side
Non-arrow side “somehow depends upon” arrow side
(small arrow side may be an interface)
Maybe “uses’ , calls, creates, sends, instead of “depends
upon”
To large arrow - realizes (implements or executes)
Non arrow side implements or executes arrow side
Chapter 7 Design and implementation
5
Inventory UML
ProductManager knows Product exists, but
Product does not know. PM changes product
Simple Product is a product
manager
A product manager can be a
Simple Product manager
Try one (observer)
Subject has an observer (diamond)
Observer is part of a subject (diamond)
Observer is owned by Subject (filled circle)
Concrete subject is a subject
Concerted subject is the
information being observed
Concrete Observer is a Observer
Concrete observer holds one
copy of the subject's state
One More - File Inventory
An element has a inventory relationship, which deletes when the element is gone
Elements are
part of
inventory
container, and
inventory
model and
should be
deleted when
container gone
All these files
are types of
Inventory
Items
Directory and
path are
inventory
containers
Items and
containers are
inventory
elements