Software design

Reading Time: 3 minutes

What is Software Design ?

  • It is a Process of planning system architecture and components.

Important Concepts

Abstraction :  hiding unnecessary details.

Modularity :  dividing system into smaller modules.

Cohesion :  how closely related functions are inside a module. & high cohesion is good.

Coupling : dependency between modules. & low coupling is good.

Abstraction

Abstraction is the process of hiding unnecessary implementation details and exposing only the essential features of a system or component.

Simple example : driving a car : you know how to drive without knowing how the engine works internally , in programming: a function hides the internal logic, and you just call it.

Importance : reduces complexity , makes software easier to understand , helps in reusability and maintenance

Modularity

Modularity is the design principle of dividing a system into smaller, independent modules that can be developed, tested, and maintained separately.

Simple example : a banking system

  • Module 1  :  accounts
  • Module 2  :  transactions
  • Module 3  :  loan processing

Each module can work independently.

Importance : simplifies development , easier testing and debugging , encourages reuse of modules

Cohesion

Cohesion measures how closely the functions inside a module are related to each other.

  • High cohesion : all functions in a module serve a single, well-defined purpose  :  good design.
  • Low cohesion : module has unrelated functions  :  poor design.

Simple example:

  • High cohesion: a “login module” only handles authentication
  • Low cohesion: a “login module” also manages user payments and reports  :  bad design

Importance:  easier maintenance , better readability , modules can be reused

Coupling

Coupling measures how dependent one module is on another module.

  • Low coupling  :  modules are independent  :  good design
  • High coupling  :  modules depend heavily on each other  :  bad design.

Simple example:

  • Low coupling: “payment module” only communicates via an interface with “accounts module”
  • High coupling: “payment module” directly accesses all functions of “accounts module”  :  changes in one affect the other

Importance:

  • Low coupling  :  easier maintenance and testing
  • High coupling  :  changes in one module ripple through system

Uml ( unified modeling language )

  • Uml is a standard visual modeling language used to design, visualize, and document software systems.
  • Helps represent system structure and behavior before actual coding.
  • Widely used in object-oriented software engineering.

Use case diagram

A use case diagram shows how users (actors) interact with the system.

Key elements:

  • Actor: external entity interacting with the system (user, external system)
  • Use case: functionality or service provided by the system

Example:

  • Actor: customer
  • Use cases: login, make payment, generate report

Class diagram

A class diagram shows the static structure of a system by representing classes, attributes, methods, and relationships.

Key elements

  • Class: rectangle divided into 3 parts (name | attributes | methods)
  • Relationships: inheritance, association, aggregation, composition

Example

  • Class: bank account
  • Attributes: account number, balance
  • Methods: deposit(), withdraw()

Sequence diagram

A sequence diagram shows the flow of interaction between objects over time.

Key elements

  • Objects/participants: represented as rectangles
  • Messages: arrows showing communication
  • Lifelines: dashed vertical lines representing object lifetime

Example

  • Customer  :  atm  :  bank server
  • Messages: insert card(), validate(), dispense cash()

Activity diagram

An activity diagram models the workflow or sequence of activities in a system or process.

Key elements:

  • Activity: action or operation
  • Decision: conditional branching
  • Start/end nodes: indicate start and finish of workflow

Example :

  • Online shopping workflow:
  • Start  :  login  :  select product  :  add to cart  :  payment  :  end