How to code for future O/R framework change?

Discussions

EJB design: How to code for future O/R framework change?

  1. Title says it all --- what resources are out there / techniques in use for coding with an eye for future O/R framework change?

    Specifically, if you wanted to get out of EJB 2.X CMP / CMR to something else in the future, how can you help yourself out now?
  2. Title says it all --- what resources are out there / techniques in use for coding with an eye for future O/R framework change?Specifically, if you wanted to get out of EJB 2.X CMP / CMR to something else in the future, how can you help yourself out now?
    I did a similar kind of work in my project. Basically I defined a set of interfaces which have all the persistance methods, like load, store, find etc defined in it. I created a Persistance Manager which can be configured to use any persistance implementation dynamically(Using Class.newInstance()). Whatever persistance implemenation you use, have to implement the interface defined by you. You can switch to any implementation like toplink, DAO ... as long as it implements your methods

    Hope this helps,
    Senthil.
  3. Title says it all --- what resources are out there / techniques in use for coding with an eye for future O/R framework change?Specifically, if you wanted to get out of EJB 2.X CMP / CMR to something else in the future, how can you help yourself out now?
    Hi!

    If you have time to, I recommend you to read about entity beans with bean manged persistence in the EJB specification. Although you don't build EJBs, you can learn a lot from the text.

    /Tomas