|
|
Creational Patterns
-
Creational patterns employ an
abstract instantiation process. They make system independent of how
objects are created, composed, represented.
-
This is important as systems
evolve to depend more on object composition than class inheritance.
Instead of hardcoding a set of behaviors, creational patterns allow you
to define small sets of fundamental behaviors that can be composed into
any number of more complex ones.
- Two themes of creational patterns:
- Encapsulate knowledge about which concrete classes the
system uses.
- Hide how instances of these classes are put together.
- Some creational patterns include:
- Abstract factory
- Factory method
- Prototype
Abstract Factory
|