Inheritance Managed Persistence

We don't want every business class writing its own persistence; we use many developers for business classes, and want them to be able to concentrate on business issues, not having to worry about persistence. So we (and many others in similar situations), made a superclass called PersistentObject, which contained the protocol, caught the "save this object" message, etc.

Good trick, and reasonably obvious application of encapsulation, inheritance, etc. Downside is you have to have source code and recompile to change the PersistenceMechanism, unlike ContainerManagedPersistence (as I understand it). -- AlistairCockburn

If you want to use different a QueryLanguage / QueryApi? you still need to recompile, even with ContainerManagedPersistence, there is no way around that


In ComponentBasedDevelopment, sometimes inheritance isn't possible, so you can't directly reuse a superclass like PersistentObject. For instance, COM doesn't have inheritance. This causes you to do component reuse ways like these:

Depending on your context, you can use one or a combination of the above in conjunction with others to get the job done in a way that balances prevailing forces. -- PhilipEskelin


Understanding Object Persistence


This is useful in languages that have little or no support for reflection. In reflective languages, object persistence is implemented by PersistenceMapping?.


CategoryPersistence


EditText of this page (last edited December 30, 2008) or FindPage with title or text search