Design Patterns · Middle · Question 5 of 75

When is an Abstract Factory appropriate instead of a simple factory?

Explanation

Example: a UI kit for two platforms - the factory creates a button, an input and a modal in one style, and they can't be mixed. A simple factory picks one product by a parameter. Don't introduce an abstract factory if there's only one family.

Further reading

Problem with a question

Design Patterns · Middle · question 5

Test yourself

Take the Design Patterns · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz