859 B
859 B
layout, title, folder, permalink, categories, tags
layout | title | folder | permalink | categories | tags | |||
---|---|---|---|---|---|---|---|---|
pattern | Factory Kit | factory-kit | /patterns/factory-kit/ | Creational |
|
Also known as
Virtual Constructor
Intent
Define factory of immutable content with separated builder and factory interfaces.
Applicability
Use the Factory Kit pattern when
- a class can't anticipate the class of objects it must create
- you just want a new instance of custom builder instead of global one
- a class wants its subclasses to specify the objects it creates
- classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate