dimanche 6 octobre 2019

What are some design patterns to handle when the domain object changes but the database hasn't?

Consider the following Enum:

enum Size{
  SMALL,
  MIDDLE,
  LARGE
}

which we will save to the database using its toString method. Now later on we decide to change MIDDLE to MEDIUM. But we are unable to update the database, so now we will have a mixture of MIDDLE and MEDIUM values stored.

What are some design patterns to handle this transformation java?

Aucun commentaire:

Enregistrer un commentaire