jeudi 5 mars 2020

Factory pattern and callouts to other methods outside factory

There is a huge discussion at my work what a factory pattern is.

The main discussion point is whether one within a factory under creation of the object also may branch out calls for population of its sub classes through other factories.

Or the parent factory needs these details beforehand as a part of its constructor as a parameter along with other data?

Is it ok to call other factories inside a factory? or should a factory be self contained and completely independant?

Aucun commentaire:

Enregistrer un commentaire