vendredi 12 juin 2020

Is reading from a configuration file an example of the builder pattern?

I'm having a hard time understanding the builder pattern properly.

Imagine that I have three classes: Reader, Builder, and Product.

TheReader class is responsible for reading the contents of a configuration file. Furthermore, the Builder class populates its own fields by using the Reader to read a configuration file. This Builder class is, thus, responsible for creating a new Product object that takes aBuilder object as a constructor parameter. This is done through a Build method which returns a new Product object. Would you describe this as an implementation of the "Builder pattern"?

Aucun commentaire:

Enregistrer un commentaire