25-Comp-B11 Advanced Software Design · Paper printed May 2019
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer) · Last updated
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
Name. A short, memorable handle (e.g. "Observer") that becomes shared vocabulary — naming a pattern lets designers communicate an entire solution shape in one word.
Motivation. A concrete scenario illustrating the recurring design problem the pattern solves, grounding the abstract structure in a relatable example before the general solution is presented.
Applicability. The situations in which the pattern should be applied — the recognizable symptoms in a design (or in the requirements) that indicate this pattern, rather than another, is the right fit.
Forces. The competing concerns or constraints the pattern must balance (e.g. flexibility vs. performance, simplicity vs. extensibility) — understanding the forces explains WHY the solution is shaped the way it is.
Solution Structure. The static structure of the solution — the classes/objects involved, their responsibilities, and their relationships, typically shown as a UML class diagram.
Consequences. The trade-offs of applying the pattern — both benefits (e.g. increased flexibility) and costs (e.g. added indirection or number of classes) — so a designer can judge whether the trade-off is worthwhile for the case at hand.
Implementation. Practical guidance, pitfalls, and language-specific techniques for realizing the structure correctly (e.g. how a given language's features make one variant easier than another).
Sample code. A concrete code fragment in a specific language showing the pattern's structure translated into an actual, compilable implementation.
Known applications. Real, existing systems or libraries that use the pattern, giving evidence the pattern is proven rather than theoretical.
Relation to other patterns. How the pattern combines with, is often used alongside, or can be confused with other patterns (e.g. Question 16's State/Strategy pair share an almost identical structure diagram but differ in intent).