[Zope3-dev] persistence by adaptation, and aop?
Shane Hathaway
shane@zope.com
Tue, 03 Jun 2003 13:31:15 -0400
Ken Manheimer wrote:
> In jon udell's latest column, he notices a pattern in several flavors
> of java object persistence mechanisms - an aspect-oriented programming
> characterization. It got me to thinking about how we continue to do
> persistence as a mixin for objects, and wondering whether we could do
> it with our alternative to AOP, adapters... I don't know enough about
> components' innards to judge, and am wondering what those i in the
> know think of the idea?
It would be possible to implement all features of object persistence
using a pure adapter-like pattern except:
- Loading object state only when needed
- Notifying the persistence mechanism when the object changes
As Steve suggested, you can get these two things using proxies, but that
could add significant complexity. I am of the opinion that the only way
to really improve upon the Persistent mix-in is to add support for these
two hooks to Python itself.
Shane