[Zope3-dev] Interfaces and Schemas

Steve Waterbury golux at comcast.net
Fri Aug 8 21:11:40 EDT 2003


Stephan Richter wrote:
> On Friday 08 August 2003 16:58, Steve Waterbury wrote:
> 
>>Basically, I see schemas and interfaces as complementary, and
>>perhaps "equal" in a sense. 
> 
> In Zope 3, Schemas and Interfaces are equal all the way!

True -- I meant "equal" in a different sense:
"equal" in status, but not in semantics (and therefore
not subject to identical treatment).  I should have
left it at "complementary" (in a sense somewhat akin
to the quantum concept of "duality").

This actually goes to the root of the issue: the
types of applications for which Zope and Zope 3
are designed is browser-centric, so interfaces and
schemas are generally simple and can be handled
identically.  This is not the case for my application,
which will interact with browsers, "thick" gui
clients, and complex applications such as CAD/CAE
tools and Product Data Management systems, for which
the distinction between schemas and interfaces
is quite pronounced.

The distinction is only observable at high energies.
Zope space is more Newtonian.  (Okay, I guess I've
beat that metaphor to death! ;^)

> This was our original design, but Jim was hitting with a hammer on my head 
> insisting that this is not a good idea. :-) I believe him now. The separation 
> between interface and schema objects would be artificial and would introduce 
> a lot of unnecessary complexity. 

I suspect that this is true within the design context
of Zope 3.

> BTW, you contradict yourself here; first you tell me that schemas and 
> interfaces should be equal, but then you write about a separation of the two.

See above -- I meant "equal" in status, although distinct
in semantics.  Basically, a schema is a "content model"
(a.k.a., an information model); an interface is an API.
They are different in the same way that information
modeling is different from object modeling (e.g.,
E-R modeling vs. UML modeling), although in first-order
cases they can have large overlaps or even be identical.

Another way of looking at it is that interfaces treat
objects as "black boxes" with specified behaviors,
whereas schemas treat them as "white boxes" (or at
least "translucent boxes") for which a well-defined
set of properties are exposed.

In relatively trivial areas (get and set), API's are
of course semantically equivalent to schemas.  (The
first-order case.)

> We think that this separation is YAGNI! Note that we also usually do not 
> specify accessor and mutator methods, since we use Python's property 
> functionality. 

I can understand that this distinction might be YAGNI
for Zope, but I don't think it is for my application context.

>>Perhaps more importantly, is it of interest at all?
> 
> Seperating Interfaces and Schemas? Probably not in the near future. We are 
> really happy about our Interface/Schema functionality.

Thanks, that answers my question!
I'll go back and play in my sandbox now.  :^)

Cheers,
Steve.





More information about the Zope3-dev mailing list