Referencial Integrity in ZCatalogs
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
Have a look at Archetypes, it does what you want. http://sourceforge.net/projects/archetypes -- Roché Compaan Upfront Systems http://www.upfrontsystems.co.za 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@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 )
En/na Roché Compaan ha escrit:
Have a look at Archetypes, it does what you want.
I think you are talking about SQLStorage of Archetypes. Storing some attributes in a Relational Database and using foreign keys in it can solve the problem. But I have some inconveniences to use Archetypes: 1) I don't use CMF. My applications aren't content management applications, but business oriented applications. 2) I like to distribute my applications without needing BBDD installation. Just download and run. Having a relational database backend will need some extra installation In any case, use SQLStorage without CMF could be interesting. I don't know if it is possible. Do you know ? Thanks Santi Camps
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@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
En/na Russ Ferriday ha escrit:
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.
Um, this seems something more what I'm looking for. I can see that ReferenceEngine and Referenceable implements some referential at object level. I was thinking about to do it at catalog level, maintaining a paralelism with a referential model, where catalog = table. But making an implementation like Archetypes one is another good option, of course. Unfortunately, I don't use CMF in my application. I use a structure of frames to work, and also a lot of javascript and DHTML, translatable javascript content, etc. Working this way is easy don't use CMF that accommodate to it. Thanks for the info Santi Camps
participants (3)
-
Roché Compaan -
Russ Ferriday -
Santi Camps