Florent Guillaume wrote:
Jim Fulton wrote:

I think that sources are different than initial value.  I really don't
see any role that "initial value" has in an object specification.

A schema is a specification for an object that provides the schema.
An initial value doesn't constrain or specify the object.  If anything,
it constrains applications that create the object, but in a rather unclear
way.


But a schema is useful for more than "specifying the values of an object". All notions of schemas I've encountered (CPS Schemas, XML Schemas, Archetypes) use the schema to constrain or validate an existing object, yes, but also to create new objects from scratch (even in the absence of widgets). Being able to specify initial values is quite important there.

It's not clear to me that XML schemas specify this.  I'm quite skeptical
than they do.  (They have this mysterious "initial value" thing that
I can't make any sense of.)  I can't believe that XML schemas deal
with the history of a document, which would seem necessary to give
inital value, as we mean it, any meaning.

Archetypes, of course is something completey different.

Zope schema are interfaces.  They specify something.  They are
not supposed to provide presentation or even application logic.
Of course, they already violate this in more ways than the default only.

It's also worth noting that we rarely constrain the initial
value for an object using the information in a field. Rather,
we use it as an initial setting in an input form.

For now, I'm willing to defer on this issue, although I think
it's a mistake to have "initial value" in schema fields.  It's
probably no worse than having title and description, or than
having fields be responsible for validation or data access and
update.

Eventually, I'd like to revisit fields as described in:

  http://mail.zope.org/pipermail/interface-dev/2004-June/000048.html

At that time, I'll be much more agressive about separating specification
from application behavior.

Finally, note that formlib form fields provide a place to capture
reusable application information, like labels, help, and initial
values.  Form fields are much more like Archetypes fields in this
regard.

Jim

--
Jim Fulton           mailto:[EMAIL PROTECTED]       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to