Modulo design is used to maximize cohesion and minimize coupling. Which of the…

2015

Modulo design  is used to maximize cohesion and minimize coupling. Which of the following is the key to implement this rule ?

  1. A.

    Inheritance

  2. B.

    Polymorphism

  3. C.

    Encapsulation

  4. D.

    Abstraction

Attempted by 254 students.

Show answer & explanation

Correct answer: C

Answer: Encapsulation

Why this is correct: Encapsulation groups related data and the operations that manipulate that data inside a single module and hides the module's internal representation behind a clear interface. This achieves the two goals:

  • Maximizes cohesion: By keeping related responsibilities and data together, each module has a focused purpose and the code within the module works closely toward that purpose.

  • Minimizes coupling: By hiding implementation details and exposing only necessary interfaces, other modules depend on stable contracts rather than internal representations, reducing inter-module dependencies.

Practical tips to apply encapsulation in module design:

  1. Define a small, well-documented public interface for the module.

  2. Keep internal data and helper functions private; do not expose implementation details unnecessarily.

  3. Assign each module a single, coherent responsibility to increase cohesion.

  4. Prefer composition and well-defined interfaces over exposing implementation details or tight inheritance hierarchies that increase coupling.

Summary: Encapsulation enforces module boundaries by hiding internals and exposing a clear interface, which directly increases cohesion within modules and reduces coupling between them.

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Mppsc Assistant Professor