mercredi 13 janvier 2021

Design pattern for populating an object with data

Is there a design pattern that covers populating an object with data?

More specifically I am thinking about an object that can contain many different data fields. When I request such an object from a method I would like to be able to specify the amount of data populated, eg. LOW, MID, HIGH but not limited to these values and maybe even more fine grained. It can be done by just creating a ENUM and call the method with that ENUM as a parameter. But is there a desing pattern that describes a better solution?

Aucun commentaire:

Enregistrer un commentaire