[Zope-dev] PostgreSQL and Racks (was Alternative Storages)

Phillip J. Eby pje@telecommunity.com
Thu, 04 May 2000 09:30:21 -0500


At 10:25 PM 5/3/00 +0000, Jerry wrote:
>
>In the worst case, perhaps a PostgreSQL implementation of
>a Rack could be expected to directly handle aspects of 
>Object Persistence that must be supplemented with 
>Property Sheets, etc. in alternate implementations.

Once there's an SQLRack done (probably this summer, unless somebody else
takes up the gauntlet sooner), it would be straightforward to add
additional functionality.  All the ZPatterns tools are based on a plugin
architecture, and in the case of Rack, there are tabs where you can add
"Attribute Providers" and "Sheet Providers".  To do what you describe, one
would write an AttributeProvider class that worked with whatever PostgreSQL
capabilities were desired.  The user of a Rack would then simply select
your AttributeProvider from the appropriate tab's "Add" list, and then
configure it.  Part of your class's behavior would be to inform the
containing rack what attributes it handles read requests for, and which it
handles write requests for.  Note, by the way, that an AttributeProvider or
SheetProvider does not have to store its data in the same place where the
"base object" is stored.  One could provide PostgreSQL data for a
persistent object, or persistent data for a PostgreSQL object, or merge two
SQL databases' data together with an LDAP entry.  The Rack doesn't care, it
just passes on the RackMountables' requests for data to the registered
providers for that data.