0% found this document useful (0 votes)
223 views11 pages

CSE 425: Software Design and Pattern: Section 1

The document discusses UML (Unified Modeling Language) diagrams including class, object, and interaction diagrams. It explains how to construct class and object diagrams by showing the notation for classes, objects, attributes, methods, and relationships. Examples of class, object, and sequence diagrams are provided along with questions asking to draw diagrams for ticket-issuing, video conferencing, and online music gift systems.

Uploaded by

testtest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
223 views11 pages

CSE 425: Software Design and Pattern: Section 1

The document discusses UML (Unified Modeling Language) diagrams including class, object, and interaction diagrams. It explains how to construct class and object diagrams by showing the notation for classes, objects, attributes, methods, and relationships. Examples of class, object, and sequence diagrams are provided along with questions asking to draw diagrams for ticket-issuing, video conferencing, and online music gift systems.

Uploaded by

testtest
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

CSE 425: Software

Design and Pattern


Section 1
UML:
• UML stands for Unified Modeling Language.
• It is graphical representation language for object-oriented
programming.

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.

How to draw Class Diagram:

Name of class

Variables: Datatype

Methods

Example:

Card

Card_id:int

<<constructor>> Card(int id)


+tostring:string
Key:
• + means public visibility.
• # means protected visibility.
• - means private visibility.
• <blank> means default (package) visibility.
• static variables are underlined.

Relations between Class Diagrams:


1. Association: a relationship between instances of the two
classes. In a diagram, an association is a link connecting two
classes.
2. Aggregation: an association in which one class belongs to a
collection. In a diagram, an aggregation has a diamond end
pointing to the part containing the whole.
3. Generalization: an inheritance link indicating one class is a
superclass of the other. In a diagram, a generalization has a
triangle pointing to the superclass.

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.

You might also like