Design
Design
DA-IICT
Design (Why?)
Saurabh Tiwari
Managing Complexity
&
Changeability
1
9/16/24
W5H2
Why OO?
What is OOAD?
Who...
When...
Where...
How to do OOAD?
How much...
2
9/16/24
Real-World Objects
Bicycle Class
Attributes
Frame size
Abstract Wheel size
into Number of gears
Material
Operations
Shift
Move
Repair
Bicycle Objects
Real-World Objects
3
9/16/24
Process ...
Why Object-Oriented?
• “The "software crises" came about when people realized the major
problems in software development were … caused by
communication difficulties and the management of complexity”
[Budd]
4
9/16/24
5
9/16/24
6
9/16/24
What is Object-Orientation?
Classification à classes à Instantiation
7
9/16/24
What is OOAD?
Traceability!!!
How to DO OOAD?
Notation Vs Process…
8
9/16/24
9
9/16/24
Abstraction
• Chunking:
• Group collection of objects to reduce complexity
• State-code, city-code, TUM-code, Office-Part
Abstraction
10
9/16/24
Abstraction
• Implement
11
9/16/24
• Task Model:
– PERT Chart: What are the dependencies between tasks?
– Schedule: How can this be done within the time limit?
– Organization Chart: What are the roles in the project?
• Issues Model:
– What are the open and closed issues?
• What blocks me from continuing?
– What constraints were imposed by the client?
– What resolutions were made?
• These lead to action items
• Functional decomposition
– The system is decomposed into modules
– Each module is a major function in the application domain
– Modules can be decomposed into smaller modules.
12
9/16/24
Decomposition (cont’d)
• Object-oriented decomposition
– The system is decomposed into classes (“objects”)
– Each class is a major entity in the application domain
– Classes can be decomposed into smaller classes
Functional Decomposition
System
Function Top Level functions
13
9/16/24
Autoshape
Change Draw
Object-Oriented View
Autoshape
Draw()
Change()
14
9/16/24
What is This?
Cave
Ellbow Neck
Glove
Pocket
Coat
An Eskimo!
Hair
Eye
Nose
Ear
Mouth
Chin
A Face!
15
9/16/24
Cave Hair
Neck Eye
Ellbow Nose
Glove Ear
Pocket Mouth
Coat Chin
Modularity
Interfaces
• Separation of concerns
– Improved modifiability/maintainability
16
9/16/24
Hierarchies
34
17
9/16/24
Part-Of Kind-Of
35
– Ensure Usability
• Produce to be consume
– Communication
– Simplicity
– Open to change
– Employ Reuse
– Feedback
– Think
36
18
9/16/24
37
• A model should
– use a standard notation
– be understandable by clients and users
– lead software engineers to have insights about the system
– provide abstraction
19
9/16/24
OO Concepts
Polymorphism
20
9/16/24
io n??
lizat
Ge nera
t is
Wha
Interface
le
21
9/16/24
Class Modeling
43
Objects
Consists of
• Identifier
• Values
• Behavior
44
22
9/16/24
45
Classes
46
23
9/16/24
Classes
Objects
47
Class
48
24
9/16/24
Class Diagrams
All objects of this class (instances of this class) share the same
behaviour, and have the same set of attributes (each object has its
own set).
Class Diagrams
25
9/16/24
Class Diagrams
Attributes
In UML, Attributes are shown with at
least their name, and can also show
their type, initial value and other
properties. Attributes can also be
displayed with their visibility:
+ public attributes
# protected attributes
- private attributes
Class Diagrams
Operations
+ public operations
# protected operations
- private operations
26
9/16/24
53
54
27
9/16/24
Object Relationships
• Association
• Aggregation Part can exist without whole
• Composition Part can NOT exist without whole
• Inheritance
• Dependency
55
UML History
28
9/16/24
29
9/16/24
30
9/16/24
Object Diagrams
31
9/16/24
Source: Wikipedia
64
32
9/16/24
Actor.
System boundary
Actor
ReadTime
SetTime
WatchUser WatchRepairPerson
ChangeBattery
33
9/16/24
Association
Class
Multiplicity
SimpleWatch
1 1 1 1
2 1 2 1
PushButton Display Battery Time
Association
Class
Multiplicity Watch
1 1 1 1
2
1 2 1
PushButton
state LCDDisplay Battery Time
push() blinkIdx Load Now
release() blinkSeconds()
blinkMinutes()
blinkHours()
stopBlinking()
referesh() Operations
Attribute
34
9/16/24
stopBlinking()
Activation
button1&2Pressed button2Pressed
Blink Increment
Hours Hours
Transition button1Pressed
button1&2Pressed button2Pressed
Blink Increment
Minutes Minutes
State
button1Pressed
button2Pressed
Stop Blink Increment
Blinking Seconds Seconds
Final state
35
9/16/24
Diagrams in UML
36
9/16/24
37
9/16/24
38