Software design translates requirements into a blueprint for building the system. Good design is modular, maintainable, and minimizes complexity through cohesion and coupling principles.
🔗 Cohesion & Coupling
These are the two fundamental measures of module quality in software design. The goal is high cohesion and low coupling.
Cohesion (High = Good)
How strongly related the responsibilities within a single module are.
Cohesion Types (Weakest → Strongest)
Coincidental (worst)
Logical
Temporal
Procedural
Communicational
Sequential
Functional (best) ✓
Coupling (Low = Good)
How much one module depends on another module.
Coupling Types (Strongest → Weakest)
Content (worst)
Common
External
Control
Stamp
Data (best) ✓
⚙️ Function-Oriented Design Approach
Decomposes the system into a hierarchy of functions (modules). Uses Data Flow Diagrams and Structure Charts as primary tools.
Data Flow Diagrams (DFD)
A DFD shows how data flows through a system — what processes transform it, where it is stored, and who interacts with it. No control flow, only data flow.
DFD Notation & Level-0 Example
Structure Chart
Shows the modular structure of a program — which module calls which, and what data passes between them. Derived from the DFD.
Structure Chart — Library System
Transforming DFD into Structure Chart
Transform Analysis: Identify central transform bubble in DFD → becomes main module
Transaction Analysis: Identify transaction centers → each transaction becomes a module
Input streams become input modules, output streams become output modules
Data stores become data access modules
🎯 Object-Oriented Design Approach
Models the system using objects — instances of classes that have attributes (data) and methods (behavior). Uses UML as the standard modeling language.
UML Diagrams Overview
Structural Diagrams
Class Diagram — classes, attributes, methods, relationships
Object Diagram — specific instances
Component Diagram — software components
Deployment Diagram — hardware topology
Behavioral Diagrams
Use Case Diagram — system functionality
Sequence Diagram — time-ordered interactions
Collaboration Diagram — object interactions
State Diagram — object state changes
Use Case Model
Shows who (actor) can do what (use case) with the system. Captures functional requirements from a user perspective.
Use Case Diagram — Library System
Class Diagram
Class Diagram — Book & Member
Interaction Diagrams (Sequence Diagram)
Shows the time-ordered interactions between objects. Each vertical line is an object's lifeline; horizontal arrows are messages between them.