Download presentation
Presentation is loading. Please wait.
1
Software Design
2
3 SWEBOK KAs covered so far
^4 We’ve added one! Software Requirements Software Design Software Construction Software Testing Software Maintenance Software Configuration Management Software Engineering Management Software Engineering Process Software Engineering Models and Methods Software Quality Software Engineering Professional Practice Software Engineering Economics Computing Foundations Mathematical Foundations Engineering Foundations
3
3 SWEBOK KAs covered so far
^4 Software Requirements Software Design Software Construction Software Testing Software Maintenance Software Configuration Management Software Engineering Management Software Engineering Process Software Engineering Models and Methods Software Quality Software Engineering Professional Practice Software Engineering Economics Computing Foundations Mathematical Foundations Engineering Foundations Today’s topic
4
Software Design Subtopics
We’ll touch on a bunch of these today!
5
Much of SE involves designing—be it artifacts, procedures, etc.
What is design? Create component or process Not just code With desired properties Design objectives/constraints Involves decision making Design decisions Much of SE involves designing—be it artifacts, procedures, etc.
6
What is design? Create component or process With desired properties
Not just code With desired properties Design objectives/constraints Involves decision making Design decisions What are some for software components?
7
Some desirable properties for software components
Reusable Understandable Modifiable Extensible Maintainable Readable Reliable Efficient (as in performance) … Tradeoffs and prioritization may be necessary!
8
What is design? Create component or process With desired properties
Not just code With desired properties Design objectives/constraints Involves decision making Design decisions How to make good decisions?
9
Making software design decisions
Design principles: High-level, fundamental advice More general Design patterns: Tried and true template solutions to common problems More specific Conform to principles
10
Making software design decisions
Design principles: High-level, fundamental advice More general Design patterns: Tried and true template solutions to common problems More specific Conform to principles Example principle:
11
Making software design decisions
Design principles: High-level, fundamental advice More general Design patterns: Tried and true template solutions to common problems More specific Conform to principles Let’s see an example pattern
12
Model-View-Controller (MVC) Architectural Pattern
Timeout! What do we mean by “architectural”?
13
Two levels of software design
Architectural design: High-level structure of software system Detailed design: Low-level design of individual components/modules/classes
14
Model-View-Controller (MVC) Architectural Pattern
Timeout! What kind of diagram is this?
15
Data Flow Diagrams components flows
16
Model-View-Controller (MVC) Architectural Pattern
Being “architectural”, these components may contain many subcomponents (classes, etc.)
17
MVC Component Responsibilities
Timeout! What do we mean by “responsibilities”?
18
Responsibility-Driven Design
Frames object design as deciding How to assign responsibilities to objects How objects should collaborate What role each object should play in a collaboration
19
MVC Component Responsibilities
View: Responsible for UI (buttons, etc.)
20
MVC Component Responsibilities
Model: Business logic, domain objects
21
MVC Component Responsibilities
Controller: Translates UI actions into operations on domain objects
22
MVC Component Responsibilities
What principle does MVC follow?
23
MVC Component Responsibilities
What principle does MVC follow?
24
MVC Component Responsibilities
What good properties does this principle/pattern engender?
25
How Rails applies MVC
26
Browser sends HTTP request
How Rails applies MVC Browser sends HTTP request
27
Router translates to action (method call)
How Rails applies MVC Router translates to action (method call)
28
Controller performs actions on model
How Rails applies MVC Controller performs actions on model
29
Model manipulates (CRUD) the database
How Rails applies MVC Model manipulates (CRUD) the database
30
Model returns data to the controller
How Rails applies MVC Model returns data to the controller
31
Controller passes data to view
How Rails applies MVC Controller passes data to view
32
View creates HTML based on data
How Rails applies MVC View creates HTML based on data
33
Controller sends HTTP response to browser
How Rails applies MVC Controller sends HTTP response to browser
34
Must you write the entire model/view/controller?
How Rails applies MVC Must you write the entire model/view/controller?
35
How Rails applies MVC Must you write the entire model/view/controller?
No. Rails provides a framework, and you extend it But how?
36
Files to extend Rails app/views/… app/controllers/… config/routes.rb
app/models/…
37
Ch. 2 Example: config/routes.rb
“resources” line creates these routes
38
All controllers are part of this class hierarchy
Ch. 2 Example: app/controllers/microposts_controller.rb All controllers are part of this class hierarchy
39
What kind of diagram is this?
Ch. 2 Example: app/controllers/microposts_controller.rb Timeout! What kind of diagram is this?
40
UML Class Diagram classes inherits relation-ship
41
All controllers are part of this class hierarchy
Ch. 2 Example: app/controllers/microposts_controller.rb All controllers are part of this class hierarchy
42
All model classes are part of this hierarchy
Ch. 2 Example: app/models/micropost.rb All model classes are part of this hierarchy
43
Ch. 2 Example: app/views/users/index.html.erb
ERb is embedded Ruby – Combines HTML & Ruby
44
How to “hook into” frameworks (like Rails)
Extend framework classes Call framework methods Put files in certain places Follow naming conventions
45
MVC Question: What code would you change if you wanted to…
46
MVC Question: What code would you change if you wanted to…
… change the colors/style of your webapp?
47
MVC Question: What code would you change if you wanted to…
… change the colors/style of your webapp? View code
48
MVC Question: What code would you change if you wanted to…
… change how sales tax is calculated?
49
MVC Question: What code would you change if you wanted to…
… change how sales tax is calculated? Model code (and maybe Controller)
50
MVC Question: What code would you change if you wanted to…
… add a survey form?
51
MVC Question: What code would you change if you wanted to…
… add a new survey form? View, Controller, and maybe Model
52
MVC Question: What code would you change if you wanted to…
… add validation that a form input is a legal address?
53
MVC Question: What code would you change if you wanted to…
… add validation that a form input is a legal address? Model mainly (but maybe Controller and maybe View)
54
MVC Question: What code would you change if you wanted to…
… change the behavior of an existing button?
55
MVC Question: What code would you change if you wanted to…
… change the behavior of an existing button? Controller (maybe Model, maybe View)
56
What’s next?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.