[Zope3-dev] schema initial documentation

Gary Poster garyposter@earthlink.net
Fri, 19 Apr 2002 22:56:27 -0400


On Friday 19 April 2002 07:26 pm, Martijn Faassen wrote:
> ...

The whole schema idea sounds interesting; would this then eliminate 
"Attribute" from interfaces?  Rather than *forcing* a standard interface to 
divide up its properties and methods into schemas and interfaces, I think I 
would prefer these schema descriptors to be available within a standard 
interface definition--and then be able to get the property list from the 
interface, as if it were a pure schema; and the method list, with all the 
properties gone; as well as the whole shebang.

Not to say that pure schemas wouldn't also be useful.  Schemas alone would 
also be available for classes, if desired for some reason, but primarily used 
for database-row-type display and entry, and argument lists, as in the ideas 
you list.

I need to study Formulator to get the implications of this more completely, I 
think, but I get the gist, and it's cool. :-)

>     What about argument list schemas? Could be used to specify what
>     fields arguments of some methods should take. Could then be used
>     to create views for methods, also for documentation and
>     introspection.  Though this may lean too much towards static
>     typing. :)

I like this idea a lot, as long as it is optional, and as long as it can 
handle describing default values (we could dig some of this out of Python, 
yes?  if the actual argument list specifies defaults...).  As I mentioned on 
IRC at one point, it would be interesting to have an argument list schema for 
__init__ methods: that could give creation views even more automated power, 
so that we could conceivably have a generic create view that looked for an 
__init__ argument schema and displayed a form with those types for the 
creation process.  Pretty powerful.

Gary