Practice question · Match the pairs
Match each modular-design term to what it describes.
- Module
- Public interface
- DRY principle
- Parallel development
- The part of a module that other modules may use
- A self-contained unit responsible for one coherent part of the job
- Separate people work on separate modules, meeting at the interfaces
- The same logic should live in exactly one place
Hints
- One term names a unit, one names part of a unit, one names a rule and one names a way of working.
- Two of the four describe things that only become possible once boundaries are clear.
Show the answer
- Module → A self-contained unit responsible for one coherent part of the job
- Public interface → The part of a module that other modules may use
- DRY principle → The same logic should live in exactly one place
- Parallel development → Separate people work on separate modules, meeting at the interfaces
Why
Modules and their public interfaces are the structure; DRY is the rule that decides where logic belongs; parallel development is a benefit that follows once boundaries are agreed. All three of the latter depend on the first: without real module boundaries there is nothing to publish, nowhere single to put logic, and no way to divide work.
Practise Modular Decomposition and Reuse
The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.
More questions on Modular Decomposition and Reuse
- Two modules each work perfectly and fail when combined. What kind of defect does that suggest, and why do…
- SavingsAccount extends Account and overrides applyMonthly(). A variable declared as Account is holding a…
- A date-handling module is being designed. Sort each item by whether it should be public or private.
- The same block of validation logic has been copy-pasted into six files. Select every consequence the lesson…
- Order the steps of factoring duplicated logic into one reusable unit.