Unit V

Software Design

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
Rectangle = Entity Process Data Store — Level 0 (Context) DFD — Student Librarian Library System Book Database Book Request Issue Record

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
Main Controller Search Book Issue Book Return Book Calculate Fine

Transforming DFD into Structure Chart

🎯 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
Library Management System Student Search Book Issue Book Return Book Pay Fine

Class Diagram

Class Diagram — Book & Member
Book - bookID: int - title: String - author: String + getDetails() + isAvailable() Member - memberID: int - name: String - issuedBooks: List + borrowBook() + returnBook() borrows 0..* 1

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.