dimanche 19 avril 2020

Instantiate a python object according to class string stored in db- recommended design pattern?

Is this a suggested practice to save object type (as string) in db (postgresql) and instantiate the object after loading the name of the object from the db? if not- what is the suggested design pattern?

The configuration refers to some logic encapsulated in the object (the logic cannot be stored in the db...).

In other words- what is the recommended design pattern for different code which should be executed according to some value in the db...

Thanks

Aucun commentaire:

Enregistrer un commentaire