[Zope-dev] Referencial Integrity in ZCatalogs

Russ Ferriday russf at topia.com
Mon Aug 2 06:54:40 EDT 2004


Take a look at archetypes on Plone.org, and download a version from 
sf.net.
Look in particular at the ReferenceEngine, based on the catalog, and 
note that there have been implementation changes, and there's a new 
beta version.
Ben Saller and Kapil Thangavelu were part of the team responsible for 
Archetypes.
--r.
On 2 Aug 2004, at 12:46, Santi Camps wrote:

> Hi all,
>
> I've been developing database oriented applications for about 10 
> years, using zope with Relation DDBB for one year and a half, and just 
> one year using Zope with ZODB in my applications.   At this point, I 
> can see a lot of advantatges of use ZODB with Zope, but there are some 
> points where the relational model was more useful to me. In fact, the 
> main problem in my applications are relationships.   In a relational 
> world, you can specify relations using foreign keys, and also say what 
> action should be done on delete or on update (no action, set null, 
> restrict, cascade, set default).   This is very useful developing 
> business oriented applications. Using ZODB some of these relations can 
> be done using containment:   If A contains B, this is the same of 
> having a relation "1->N on delete cascade"
> Another case is to use a Relation Manager.   I've implemented and 
> object Relation that is deleted when some of the two related objects 
> are (using manage_beforeDelete).  This is the same that a relation "M 
> -> N on delete cascade"
> The third case I've been implemented, and the one giving me more 
> problems, is to have a property referencing another object (path or 
> UID).  If the referenced object is dropped, the referer has problems
>
> I work a lot with ZCatalogs, using one catalog for each meta_type of 
> objects, so for me catalogs are the most similar thing to a "Table".   
> I'm thinking that could be very useful to implement some basic 
> referencial integrity in ZCatalogs.   Just being able to define 
> primary keys and some simple types of foreign keys we will have on 
> Zope the best of two worlds.   Seeing code of ZCatalog product it 
> seems not to be very difficult to implement, adding some validations 
> on catalog_object and uncatalog_object methods.   Of course, all these 
> should be optional.   I no Primary Keys neither Foreign Keys are 
> defined, catalogs should work exactly like until now.
>
> What do you think about this ?  If nobody convince me that this is a 
> stupid work, I will try to implement it.   In this case, what's the 
> better way to provide the code ?  A patch for ZCatalog ?  Or a new 
> Product IntegrityZCatalog inheriting from ZCatalog ?
>
> Thanks
>
> Santi Camps
>
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope )
>
—————————————————————
Russ Ferriday
Solution Workshops for Plone
(+44) (0) 7789 338868
http://www.solutionworkshops.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3036 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20040802/3730e391/attachment.bin


More information about the Zope-Dev mailing list