Free Design patterns lessonsDesign patterns · Stage 0 · Creating objects · Step 2
Factory
Moving the choice of which class to create out of the caller: the simple factory, the factory method and the abstract factory. About 12 minutes.
What does a factory let callers avoid?
- AKnowing and depending on the concrete class being created
- BAllocating memory
- CUsing interfaces
Show the answer
Knowing and depending on the concrete class being created. They use the interface; the factory decides.
4 questions on this idea
Short questions that apply the idea to new cases: trace it, work out a number, put steps in order. A wrong answer explains itself.
Answer them in your browserFree account, no card. Your progress is saved, and the idea comes back in a quick review later.
Sign up free to solve