Discussion
Week 5
Welcome! Software Design Discussion
Itinerary May 10 Upcoming Deadlines
Quiz 3 review: today: 11:59 pm May 10, due today: Quiz 3
Design Studio 2 (part1) May 17, due 11:59 pm: DS2 (part1)
May 24, due 11:59 pm: DS2 (part 2)
Questions
Quiz 3
1 question, no time limit
Grading
UML = 6 points PseudoCode1 - 2pts
● Clean separation of concerns ● Correct Logic
● Clean solution for interface (super-class) ● Maps to UML
● Correct relationships including cardinality (the 1-n or 1-1
or 1-* relationships) PseudoCode2 - 2pts
● Key Attributes Listed
● Correct Logic
● Key Methods Listed
● Maps to UML
● You will loose points for
Lose points if not focused on proficiency
○ Tangled relationships of classes - spaghetti
connections
○ No cardinality, incorrect relationships
○ Incorrect use of aggregation/composition
○ Improper UML Syntax
○ Overall understandably
Design Studio 2 (part1)
Material Review
Task: Create an educational traffic flow simulation Client: Professor E, who teaches civil
program. engineering at the UCI.
Theory: Todo:
Traffic signal timing involves determining the amount of Design a software through which students can
time that each of an intersection’s traffic lights spends “play” with different traffic signal timing schemes to
being green, yellow, and red, in order to allow cars to flow explore different scenarios. She anticipates that this
through the intersection from each direction in a fluid will allow her students to learn from practice, by
manner. observing first-hand some of the traffic patterns that
Ideal case: the amount of time that people spend waiting is emerge under different signal timing conditions.
minimized by the chosen settings for a given intersection’s
traffic lights. This can be a very subtle matter: changing the
timing at a single intersection by a couple of seconds can
have far-reaching effects on the traffic in the surrounding
areas.
Requirements
● Create UML ● Software Design
○ Add explanations ○ Roads
○ Vehicles on road
● Have Pseudocode ○ Traffic lights
○ How traffic lights work? ○ Intersections
○ How cars move? ○ Density of vehicles
○ How to control vehicle density? ○ Sensor
● ChatGPT / other LLM/AI
○ At least 10 attempts
○ https://canvas.eee.uci.edu/courses/62967/modules/it
ems/2734865
Format:
Can have around 14 pages (or more based on your explanation)
1. Primary audiences & Stakeholders
a. Can explain each
2. System Design
a. UML Diagram
i. Explanation of UML
b. Pseudocode
i. Explanation of Pseudocode
ii. Overview of Pseudocode algorithm
3. ChatGPT/ other LLM
a. Explain all Interactions
i. Can add link to chats or explain them in detail (in latter case, pdf length may go above 14,
that’s completely fine)
b. Reflection
4. Extra based on Awesomeness
UML - Class Diagram
● UML: A way to visualize the work
○ Used to understand design, code architecture
and proposed implementation of complex
systems.
● Class Diagram
○ Classes: boxes
○ One box: class name, attributes, methods
○ Lines: connect classes and show relationship
among them
○ Visibility
■ + for public (visible to all classes)
■ - for private (visible only within the
class)
■ # for protected (visible to subclasses)
■ ~ for package or default visibility
(visible to classes in the same
package)
Relationships
● Present between classes
● Describes how classes are connected or
interact with each other
Reference:
https://www.geeksforgeeks.org/unified-modeling-language-uml-class-diagrams/
Association
● Represents a bi-directional relationship
between two classes.
● Indicates that instances of one class are
connected to instances of another class
Directed Association
● Represents a relationship between two
classes.
● Indicates one class is associated with
another in a specific way
● Arrowhead -> indicates the direction of
relationship
● Used when association has specific flow
or direction (this class has dependency
on another)
The arrow points from that is being targeted
to the class
the class that initiates the or affected by the
association association.
Aggregation
● Represented by a diamond shape on
the side of the whole class.
● Denotes a stronger relationship where
one class (the whole) contains or is
composed of another class (the part)
● Child class can exist independently of its
parent class.
Composition
● Stronger form of aggregartion
● Represented by a solid diamond shape
on the side of the whole class.
● Indicates a more significant ownership
or dependency relationship
● Child class can not exist independently
of its parent class.
Generalization(Inheritance)
● Represented by a solid line with a
closed, hollow arrowhead pointing from
the subclass to the superclass.
● One class (the subclass or child) inherits
the properties and behaviors of another
class (the superclass or parent)
Realization (Interface Implementation)
● Represented by a dashed line with an
open arrowhead pointing from the
implementing class to the interface.
● Both the Person and Corporation
classes realize the Owner interface,
○ They provide concrete
implementations for the
“acquire(property)” and
“dispose(property)” methods
defined in the interface.
Dependency Relationship
● Often depicted as a dashed arrow.
● Represents a more loosely coupled
connection between classes
● A dependency exists between two
classes when one class relies on
another, but the relationship is not as
strong as association or inheritance.
○ Book class does not depend on
the Person class;
○ Can exist independently and
does not rely on the Person class
for its functionality.
Usage(Dependency) Relationship
● Represented by a dashed arrowed line
pointing from the client class to the
supplier class.
● Arrow indicates the direction of the
dependency, showing that the client
class depends on the services provided
by the supplier class.
Cardinality
● Indicates the number of instances of ● Two classes as ‘Student and
Course’.
one class linked to the instances of
● A student should do one or more
another class courses,
● while a course may have zero or
more students.
Design Studio 2 (part 1)
Do not forget the Daily Smirk Usage
– At least nine different days (6 days for part 1 & 3 days
for part 2) with meaningful work (and thus ratings)
– Choose UCI email address
Important DS1: Part2 Group Discussion
- Must perform in team
- Deliverable: a single .pdf file.
Next Week’s Session Recommended Homework
- Design Studio 2 (part 1) - Design Studio 2
- Come prepared with questions and
ready to participate!