Module design is used to maximize cohesion and minimize coupling. Which of the following is the key to implement this rule?
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: C. Encapsulation
Explanation
Encapsulation packages the data and the operations that act on that data inside one module and hides the internal representation behind a narrow interface. Keeping everything that belongs together inside the module raises cohesion, while restricting other modules to the published interface removes shared data and internal dependencies, which lowers coupling — so encapsulation delivers both halves of the rule at once. Inheritance actually increases coupling between a subclass and its superclass, polymorphism is about interchangeable behaviour at run time, and abstraction is the broader idea of ignoring detail rather than the mechanism that enforces the boundary. Hence encapsulation is the key.More Programming Languages and Computer Graphics questions
- The design concept 'Refinement' is a:
- A software design is highly modular if:
- Cohesion is an extension of:
- Given 4 GB (≈ 4.3 × 10⁹ bytes) of virtual address space and a page size of 4 KB (= 4 × 10³ bytes), with each page table entry 5 bytes: how…
- A table T with 17 rows and 1024 columns is stored in memory. T[i][j] and the variable temp are 32-bit floating-point values; memory is word…
- Using the same table T (17 rows × 1024 columns, 32-bit word-addressable entries, 16 page frames of 1024 words each, LRU) and the same colum…