[Zope3-dev] Re: Interfaces and Schemas

Philipp von Weitershausen philipp at weitershausen.de
Fri Aug 8 17:41:11 EDT 2003


Steve,

> Basically, I see schemas and interfaces as complementary, and
> perhaps "equal" in a sense.

Schemas *are* interfaces in Zope3. They are semantically the same.

> The idea I'd like to propose is
> that an interface could have a schema associated with it, and
> that they could be similarly named -- e.g., an IDocument and
> an SDocument.  And there should probably be well-defined
> (i.e. testable) relationships between the methods of IDocument
> and their effects on the "fields" (which in some cases may be
> state-dependent) of SDocument.  And each could have families
> of Adapters, which in general would be quite different.
> 
> Any class then could implement either the interface or the
> schema (or both, or neither), but presumably there would at
> least be a Document class that implements both.
> 
> Is that concept compatible with Zope 3's architecture?
> (From what I've read so far, it isn't quite compatible, but
> might be doable.)

No, it's not compatible, since we don't make a difference between a 
schema and an interface (e.g. we have views for schemas just as for 
interfaces). If you need to make assertions on an object's attributes 
and their field types, simply include them into your interface.

> Perhaps more importantly, is it of interest at all?

Probably not... I personally ask myself: Why would you like to split 
them up in the first place?

Philipp





More information about the Zope3-dev mailing list