[Zope3-dev] Re: Merging schema & interfaces (was: "Sub interface")

Derrick 'dman' Hudson dman at dman13.dyndns.org
Tue Mar 2 09:21:11 EST 2004


On Tue, Mar 02, 2004 at 10:10:34AM -0300, Sidnei da Silva wrote:
| | On Mon, 01 Mar 2004 10:05:08 -0500
| | Jim Fulton <jim at zope.com> wrote:
| | [..]
| | > There is a separate schema package because schema are much newer than
| | > interfaces. It's a packaging issue, not a technical issue.  I'm open
| | > to merging the schema package into the interface package at some
| | > point.
| 
| Now that the subject came up, I would like to ask your opinions on
| improving field constraints a bit, so one can have a bit more context
| (like the object bound to the field for example). What do you think?

+1

I think this is essential.

Imagine you are creating a contact, as in Jim's tutorial slides.  The
contact has a city, state and zip code (in the US).  Without this
context, someone could enter the address "Rochester, NY 60123".  Zip
code 60123, however, is for Elgin, IL.  If need be, I could dig out
several other real-world situations where the valid values for one
field depend on the value set in another.

This does bring up the issue, though, of order of evaluation.  Perhaps
a field could have two constraints - the first is applied only to the
pending value of the field, the second has access to all the pending
values.  All context-independent constraints are evaluated before any
context-dependent ones are.  This way a field can have an independent
sanity check that must pass before any other fields' context-dependent
constraints see the value.

-D

-- 
Contrary to popular belief, Unix is user friendly.
It just happens to be selective about who it makes friends with.
                                               -- Dave Parnas
 
www: http://dman13.dyndns.org/~dman/            jabber: dman at dman13.dyndns.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20040302/486b5a2f/attachment.bin


More information about the Zope3-dev mailing list