CSE 425: Software Design and Pattern: Section 1
CSE 425: Software Design and Pattern: Section 1
Types of Diagrams:
1. Class diagrams show the static relationship between
classes.
2. Object diagrams represent the state of a program as
series of related objects.
3. Interaction diagrams illustrate execution of the
program as an interaction among related objects.
Name of class
Variables: Datatype
Methods
Example:
Card
Card_id:int
Multiplicity:
• Default of 1 (1: 1)
• 0 or 1: 0..1
• Zero or more (0..infinite): *
• 1 or more (1..infinite): 1.. *
• n..m; range from n to m inclusive
Types of Aggregation:
Dependency:
In a diagram, a dependency is generally shown as a dashed
arrow pointing from the dependent at the tail to the provider at
the arrowhead.
Object Diagram:
Object diagram was defined as: a graph of instances, including
objects and data values. A static object diagram is an instance of a class
diagram, it shows a snapshot of the detailed state of a system at a point
in time.
How to draw Object Diagram:
Name of object: Name of class
Sequence diagram:
• Class and object diagrams are static model views.
Interaction diagrams are dynamic. They describe how
objects collaborate.
• A sequence diagram is an interaction diagram that details
how operations are carried out what messages are sent and
when.
Example:
Question 1:
Draw a UML class diagram and draw a UML sequence diagram
for each of the following systems:
• An automated ticket-issuing system used by passengers at a
railway station
• A computer-controlled video conferencing system that allows
video, audio and computer data to be visible to several
participants at the same time.
Question 2
An online music retailer has decided to create a new service product.
Customers will be able to pay for electronic “gift tokens" (of any value).
They receive a short identification code that they can send to a friend by
email. When the friend receives this code, they can visit the company
website and use it to purchase MP3 tracks up to the specified value. Any
remainder stays in an account that the recipient can use later. Draw a
suitable class diagram and object diagram. Make any assumptions that
can be needed for your solution.