Let's say there is a class called Animal which receives a request including animal's properties (type, color, size) and then it serializes and stores that in database. Over time, animal's properties change. Something is added and now we have location in addition.
There will be a version flag that can be used to branch out requests at any time.
How would you tweak animal class that it can handle the old requests as well as new ones? Is there any design patter for this?
Inheritance would work but isn't that ugly after few revision?
Aucun commentaire:
Enregistrer un commentaire