lundi 5 mars 2018

Is it appropriate for a Builder to modify a given value?

Wrestling with my conscience on this one.

I have a complex object Foo. Foo has EnrichedBar. In order to simplify construction of Foo, I am introducing FooBuilder.

Currently, it is incumbent on the client that constructs Foo to perform the mapping from Bar to EnrichedBar.

Is it appropriate to hide this enrichment within the Builder, or is that assigning too much responsibility to the Builder?

Aucun commentaire:

Enregistrer un commentaire