Monday, October 12, 2015

Implementing the Builder pattern

The builder aims at separating the construction of complex objects from their representation. Instead of using different constructors, the pattern defines a single object: the builder. This object builds the desired object step-by-step according to the configuration parameters defined by the user. The Builder is different from the Abstract factory because the former delegates the construction of the actual object to a specific auxiliary class/object, while the latter uses inheritance for exchanging concrete implementations.

No comments:

Post a Comment