2076 8

CSC375 ยท 2076 ยท 5 marks

What is modular decomposition? Discuss object oriented model of decomposition.

What is modular decomposition? Discuss object oriented model of decomposition. [5]

Software EngineeringChapter 6: Architectural DesignArchitectural Design Decisions

Quick answer

Modular decomposition is a process of decomposing subsystems into modules. After the system has been decomposed into subsystems (during system structuring), each subsystem must be further decomposed into lower-level modules such as components, objects, or functions. It is one of the key activities of the architectural design process.

Modular Decomposition and Object Oriented Model of Decomposition

Modular Decomposition

In short: System --> Subsystems --> Modules (via modular decomposition)

Two modular decomposition models are commonly used:

  1. Object Oriented Model (decomposition into objects/classes)
  2. Function Oriented (Pipeline) Model (decomposition into functions/processes)

Object Oriented Model of Decomposition

In the object oriented model, the system is decomposed into a set of loosely coupled objects with well-defined interfaces. Each object encapsulates its own private state (data/attributes) and operations (methods/behaviors).

Key characteristics of this model include:

FeatureDescription
EncapsulationEach object hides its internal state from other objects
AbstractionObjects expose only necessary interfaces
ReusabilityObjects/classes can be reused across the system
MaintainabilityChanges to one object have minimal impact on others

Steps in Object Oriented Decomposition

  1. Define the context and modes of use of the system.
  2. Design the system architecture by identifying major subsystems.
  3. Identify the principal system objects (classes) from the requirements.
  4. Develop design models such as class diagrams, sequence diagrams, etc.
  5. Specify object interfaces -- define the operations each object provides.

Example

Consider a Patient Management System:

  • It can be decomposed into objects such as Patient, PatientRecord, Doctor, Appointment.
  • Each object has its own attributes and methods.
  • Objects communicate with each other through well-defined interfaces.
Patient                 PatientRecord
-----------             ---------------
- patientID             - recordID
- name                  - diagnosis
- age                   - treatment
-----------             ---------------
+ register()            + addRecord()
+ getDetails()          + getHistory()

These classes and their associations are modeled using UML Class Diagrams, which show the static structure of the system.

Advantages of Object Oriented Decomposition

  • Software is easier to change and maintain compared to functional approaches.
  • Promotes reusability of object classes.
  • Closely models real-world entities, making design more intuitive.
  • Supports incremental development -- individual objects can be developed and tested independently.

In summary, modular decomposition breaks subsystems into manageable modules, and the object oriented model does this by organizing the system around objects that encapsulate both data and behavior, making the system more modular, reusable, and maintainable.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.