[Zope3-dev] schema initial documentation

faassen@vet.uu.nl faassen@vet.uu.nl
Mon, 22 Apr 2002 22:14:21 +0200


On Mon, Apr 22, 2002 at 03:11:12PM +0200, Godefroid Chapelle wrote:
> But I would like to point something I think is important. I hope I won't 
> state something obvious.
> 
> I think that the schema should be extensible and declarative.

I agree on this.
 
> About extensibility, it should be easy to add properties necessary for 
> other tasks - I refer to SQL generation you mentioned for example.

I think schema's representation should be rich enough to generate SQL
at least, so that there is no need to add SQL specific properties. At
least I'm hoping we don't need to add anything like that. 

> About declarativ'ity', this would allow to check the validity (according to 
> the infrastructure it is meant for) of the schema.

The main idea now is that there is a validation system which can check
whether an object's attributes actually are according to the declared schema.
Perhaps we can even do this when a property is set (and if the data it
is being set with does not conform to the object's schema then it should
raise an exception), although this leads perhaps to some issues if you
want validation of one property to be dependent on the value of another.
(though perhaps this is outside the scope of the schema per se..)

The infrastructure these schema are meant for is really just Python objects..
This reminds me of Grouch, even though the focus of that project is
different (ZODB integrity checking as opposed to form and SQL generation).

http://www.mems-exchange.org/software/grouch/

Perhaps we can leverage grouch.. Going to take a look at it again.

> IOW I would like to have it declared in XML in place of Python. It would be 
> really easy to generate the Python text from XML if needed and would allow 
> to check (at least partly) the semantics expressed through the writing of 
> DTD or XML schema.

I think making this declarable in Python as a Zope style interface is
right now the best way to go. This does not mean however we cannot map
this to a XML representation, as an XML representation has definite advantages
as well.

Regards,

Martijn