Menu

Earn Premium with Referrals

Invite your friends and earn Premium rewards through our referral program.

See how it works and start inviting friends.

Software Design Concepts
SDLC

Software Design Concepts

Master the principles of software design: high-level vs low-level design, coupling, and cohesion.

Software design transforms requirements into a blueprint for construction. It’s where architecture, modules, interfaces, and data structures are defined. The golden rule: high cohesion, low coupling.

Coupling (Inter-module dependency)

Measures how much one module depends on another. Lower is better.

Type (worst → best)Description
Content couplingOne module directly modifies data inside another (worst).
Common couplingModules share global data.
Control couplingOne module passes control flags to another.
Stamp couplingModules pass data structures but only use parts of them.
Data couplingModules pass only the necessary data (best).

Cohesion (Intra-module focus)

Measures how related the elements within a module are. Higher is better.

Type (worst → best)Description
CoincidentalRandom unrelated functions grouped arbitrarily.
LogicalFunctions grouped by category (e.g., “all I/O functions”).
TemporalFunctions grouped because they happen at the same time.
ProceduralFunctions grouped by sequence of operations.
CommunicationalFunctions that operate on the same data.
SequentialOutput of one function is input to the next.
FunctionalAll functions contribute to a single well-defined task (best).

Design Approaches

ApproachHow it worksBest for
Top-downStart with high-level system, decompose into sub-modules.Well-understood problems, structured programming.
Bottom-upBuild primitive components first, compose into larger systems.When low-level building blocks are known first.
Function-orientedDecompose by function (input → process → output).Traditional structured design.
Object-orientedDecompose by objects (data + methods).Complex systems with evolving requirements.

Design Patterns (Gang of Four — 23 patterns)

Three categories:

  • Creational — object creation mechanisms (Factory, Singleton, Builder).
  • Structural — object composition (Adapter, Decorator, Proxy, Facade).
  • Behavioral — object interaction (Observer, Strategy, Command, Template Method).

Architectural Styles

StyleDescriptionExample
LayeredEach layer serves the one above itOSI model, web apps (presentation → business → data)
MVCModel-View-Controller separationWeb frameworks (Rails, Spring MVC, Django)
MicroservicesIndependent services communicating via APIsNetflix, Amazon
Client-ServerClients request, servers respondMost web applications
Event-drivenComponents react to eventsGUI apps, real-time systems

UI Design Principles (Nielsen’s 10 Usability Heuristics)

  1. Visibility of system status
  2. Match between system and the real world
  3. User control and freedom
  4. Consistency and standards
  5. Error prevention
  6. Recognition rather than recall
  7. Flexibility and efficiency of use
  8. Aesthetic and minimalist design
  9. Help users recognize, diagnose, and recover from errors
  10. Help and documentation

Q: Explain “high cohesion, low coupling” with an example.

A: A well-designed calculator module has high cohesion (all functions are calculation-related) and low coupling (it receives two numbers and returns a result — no shared global state). A poorly designed module might handle calculations and file I/O and UI rendering (low cohesion) while depending on global variables (high coupling).

Q: What is the difference between a design pattern and an architectural style?

A: A design pattern solves a local problem (e.g., “how to create objects” — Factory pattern). An architectural style defines the global structure (e.g., “how to organize the whole application” — MVC, microservices).

Q: When would you use a microservices architecture?

A: When the system has independently deployable components with different scaling needs, release cycles, or technology requirements. Not suitable for simple CRUD apps — the operational complexity isn’t justified.

Q: What is the MVC pattern?

A: Model (data + business logic), View (UI rendering), Controller (handles user input, updates Model and View). Separates concerns so each can be modified independently.

My Private Notes

Notes are auto-saved locally to this device.