Designing Building Blocks Flashcards
7 cards from real CPSA practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Designing Building Blocks flashcards as text
Which design principle helps prevent building blocks from becoming overly large by limiting their public interfaces?
Answer: Interface Segregation Principle
The Interface Segregation Principle states that clients should not be forced to depend on interfaces they do not use, promoting smaller, focused interfaces.
A 'black box' perspective on a building block means that:
Answer: Only the block's interface and behavior are visible, not its internals
A black box view exposes only what a block does (its interface and behavior) without revealing how it does it internally.
What is the relationship between 'abstraction level' and building block granularity in architecture documentation?
Answer: Higher abstraction levels show coarser-grained blocks with fewer details
At higher abstraction levels, building blocks represent larger, coarser-grained components; detail increases as you zoom into lower levels.
Which of the following is a CORRECT way to express that Building Block A depends on Building Block B?
Answer: A's required interface matches B's provided interface
A dependency from A to B means A requires a service that B provides — A's required interface is fulfilled by B's provided interface.
In the context of building block design, what does 'stable dependency principle' prescribe?
Answer: Frequently changing blocks should depend on stable blocks
The Stable Dependency Principle states that dependencies should point toward more stable components to limit change propagation.
Which technique is MOST appropriate for decoupling two building blocks that must communicate asynchronously?
Answer: Message queues or event buses between the blocks
Asynchronous message queues or event buses decouple sender and receiver in both time and knowledge, enabling independent evolution.
What risk does a building block with too many responsibilities (a 'god class') pose to a software system?
Answer: It becomes a bottleneck for changes affecting many unrelated features
God classes accumulate responsibilities over time, causing many unrelated changes to collide in one place, slowing development and increasing defect risk.