mirror of
https://github.com/JakubVojvoda/design-patterns-cpp.git
synced 2025-12-17 21:04:36 +03:00
add Builder pattern
This commit is contained in:
12
builder/README.md
Normal file
12
builder/README.md
Normal file
@@ -0,0 +1,12 @@
|
||||
## 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
|
||||
Reference in New Issue
Block a user