[Zope3-Users] Schema fields vs custom metadata

Christophe Combelles ccomb at free.fr
Fri Feb 23 09:59:59 EST 2007


Svenn Helge Grindhaug a écrit :
> Hi,
> 
> I'm trying to make a system for course registration. The user will get a list 
> of available courses, select one and register for the course.
> 
> I have the following interfaces:
> 
> class ICourse(IContainer):
>     """Store information about the course and store participants"""
>     
>     contains('ers.interfaces.IParticipant')
> 
> class IParticipant(IContained):
>     """Store information about participants"""
>     
>     containers('ers.interfaces.ICourse')
> 
> How do I store the information about the course - when course is a container? 
> As schema fields or as custom metadata? I have tried both without success and 
> need to know which of the two are the "correct" way or if I need to change 
> the hole design.

The information about the course (I guess) is the main important information of 
your object, so it is not metadata. It would be better to store it as schema 
fields. Metadata is great to store additional information brought by an optional 
interface you put on object. Such as comments, rating, author, etc.

The fact that the object is a container doesn't not prevent you from adding any 
attributes you want. It just means that ICourse is derived from (and extends) 
IContainer.  You can also define a separate ICourseDetail with interesting 
fields, and implement both ICourse and ICourseDetail in your Course object.

Christophe

> 
> Thanks!
> 
> Svenn.
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> http://mail.zope.org/mailman/listinfo/zope3-users
> 
> 



More information about the Zope3-users mailing list