I'm thinking about possibilities to Build in my Project(s) an backward compatibility to the Database.
At the Beginning we have 1 Model and 1 Controller (ignoring the View right now).
the Model has 1 Field
the Controller uses this Class Employee:
Now we enhance the Database to Model with 2 Fields:
the new Controller will be:
and now the Question:
let's say there are more than one version in use.. older and new one...and you want to have both versions available...how do you will handle this? what are your experience?
I'm thinking about an Interface which maps to the corresponding actual fields...
Class Controller EmployeeV1(String adress)
String adress = substring(0, index.of(" "));
int code = substring(index.of(" "), adress.length);
Class Controller EmployeeV2(String adress, int code)
but i think the strategy should work but I think there should be better ways?