Win a copy of Java Database Connections & Transactions (e-book only) this week in the JDBC forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Best Practices - Strategy - Versions  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey there,

I'm thinking about possibilities to Build in my Project(s) an backward compatibility to the Database.

Example

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...

example:

Class Controller EmployeeV1(String adress)
String adress = substring(0, index.of(" "));
int code = substring(index.of(" "), adress.length);
...setAdress(adress)
...setCode(code)

Class Controller EmployeeV2(String adress, int code)
...setAdress(adress);
...setCode(code);

pseude code but i think the strategy should work but I think there should be better ways?

 
Acetylsalicylic acid is aspirin. This could be handy too:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!