I have a scenario that involves a class that is often handled as a collection of instances. In particular some methods require the full collection of instances while other methods can be used individually for each instance.
This opens several architectural possibilities. I.e. one could use a manager/coordinator class which takes control over the collection. On the other hand static methods within the class are also an options as it keeps the responsibility inside one class.
What is the best approach in this context?
Aucun commentaire:
Enregistrer un commentaire