mirror of
https://github.com/JakubVojvoda/design-patterns-cpp.git
synced 2025-12-17 12:54:36 +03:00
12 lines
649 B
Markdown
12 lines
649 B
Markdown
## Builder
|
|
|
|
Builder pattern has creational purpose and separates the construction of a complex object
|
|
from its representation so that the same construction process can create different
|
|
representations. It is object pattern, ie. relationships can be changed at run-time
|
|
and are more dynamic. Often is used for building composite structures but constructing
|
|
objects requires more domain knowledge of the client than using a Factory.
|
|
|
|
### When to use
|
|
|
|
* the algorithm for creating a object should be independent of the parts and how they're assembled
|
|
* the construction process must allow different representations for the object that's constructed |