Skip to the guide

Practice: Creating and structuring objects

MixedPractice3 pages

Here are eight questions on the patterns from this section: naming patterns in the round, Singleton, factories, Abstract factory, Builder, Adapter, Decorator, Facade and proxy, and Composite. Each question gives you a prompt and asks which design you would choose, and when the simpler design is the better one. A reasoned "no pattern here" is often the strongest answer. The last question puts several patterns together on a small design.

How to use this page. Set a timer for each question, and answer out loud or on paper before opening anything. Open a hint only if you have been stuck for more than a minute. When you are done, open Check your answer, read the worked answer and the list of what a strong answer covers, and compare them with yours. If yours missed most of it, reread the guide the question practises and try again in a day or two.