[ZODB-Dev] Pre-announce: Oscar 0.1

Christian Robottom Reis kiko@async.com.br
Mon, 27 Aug 2001 12:15:54 -0300 (BRT)


On Tue, 21 Aug 2001, Greg Ward wrote:

> First of all, let me modify the announcement a bit.  There are too many
> software packages out there already called "Oscar" -- so Oscar is dead,
> long live the Grouch!  (Does anyone who grew up outside of North America
> get it?  Oh well...)

Ewww. This looks awfully cool. Congrats, Greg, this works nicely. :)

> When/if a new schema language becomes part of Grouch, it will be offered
> as a complement to schema extraction from docstrings.

This would be an XML schema thing like we have for gnome's GAL and
libglade?

> Yes, although it's a tad clunky right now.  Eg. say I have a schema in
> schema.pkl, as created by the gen_schema script:
[... include general clunkiness ...]
> ...and around we go.  You get the picture.  The documentation for this
> API is all in the code.

Hmm. It is a bit clunky (the open database part definitely is!). Okay, so
now let me ask you this: Don't _you_ do runtime typechecking of anything?
How do you prevent 3vil things going into the database if no runtime
checking is done? Oh, this _is_ how you do runtime checking?

> > Oh, this _is_ a runtime typecheck? :)
>
> Not currently.  Right now, we do a type-checking pass nightly on our
> database.  So far, it mostly finds documentation errors -- ie. it's
> mainly peace-of-mind, rather than something that regularly finds bugs.

Okay, so if it only finds doc errors, how do you avoid user-input data to
be in the correct types? One thing that bothers me is that, f.i., GTK
entries always give me back strings, which I have to "cast" into a
float/int/DateTime/whatever.

Apart from having in-field validation (using GtkEntry's *_text callbacks),
I do validation in the domain classes.  However, this is very ugly using
custom-written code because everybody has to specify the types inside the
handler themselves (with some type(foo) == type(0.0) statements). This
could be done using Grouch's runtime system very transparently, AFAICS.
Agreed?

>   * invoke Grouch in __setattr__(), so every attribute is checked at
>     assignment time (this is the one that really scares me, performance-
>     wise)

Yeah, but for user-input data going into persistent domain classes, it's a
must.

> Give it a whirl -- pre-release tarball is at
> http://starship.python.net/~gward/Grouch-0.1.tar.gz.  Shh!  Don't tell
> anyone I mentioned this.  It's *not* the final release.  There will be
> another Grouch-0.1.tar.gz with possible differences in a few days.

Vere is da stone? :)

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 272 3330 | NMFL