Abstracting the Persistence API
530138Aug 25 2006 — edited Sep 1 2006Let me start by saying that I think the Persistence API in 3.0 is a great concept. My concern, however, is the apparent coupling of persistent classes to Berkeley DB. I've been racking my brain to figure out a way of abstracting things so as to isolate my domain code from the persistence details. At present, the only thing I have come up with is to maintain two mirrored class hierarchies: one for persistent classes and the other for transient classes, with a mapping layer between the two. While this concept has been proved in practice (see Stanford University's BaBar project), it's a management nightmare to try and keep two hierarchies of classes in sync.
Anyone have any suggestions?