[Zope3-Users] Can interfaces be mutated cleanly?

Kapil Thangavelu hazmat at objectrealms.net
Fri Apr 13 15:14:57 EDT 2007


On Fri, 13 Apr 2007 15:09:29 -0400, Hermann Himmelbauer <dusty at qwer.tk>  
wrote:

> Am Freitag, 13. April 2007 20:27 schrieb Kapil Thangavelu:
>> i would suggest some alternatives approaches to consider first.
>>
>> potentially this would be easier going the other way around with zs2sa,
>> and generating the mapper from there, you don't need to annotations as
>> well since the zope schemas contain the relevant ui metadata, and the
>> schema is the canonical definition of the rdb/sa schema. bonus is you  
>> get
>> multidb support for the schema, as an example of doing things this way,
>> https://svn.objectrealms.net/view/public/browser/ore.member/trunk/src/ore/m
>> ember/example2.py
>>
>> the transmute funcction has the options of specifying base interfaes, so
>> you also have the option at the risk of ordering dependencies of  
>> replacing
>> the iface class thats a base arg to the transmute function with the  
>> result
>> of the transmute function, presumably though if this being done in the
>> same module (interfaces.py) then its not an issue though.
>
> Interesting approach, however, I doubt this is going to work when one  
> has to
> access an existing relational database - like in my case. After all one  
> has
> once again redundant definitions.
>
> Therefore in cases where the database is designed together with the Zope3
> application, the transmute function could be an interesting approach,  
> but in
> cases where the DDL-statements already exist, the generation of schemas  
> out
> of the table definitions seem to be the better way.
>
> Moreover I'm also curious if advanced table definitions such as  
> constraints,
> checks and the like can be generated from Zope schemas.

ore.alchemist supports both notions, as both options are wanted for  
different use cases, ie both database as canonical schema representation  
and interfaces as canonical with automatic generation of the other form.  
it does support basic constraint inferment and generation from either  
canonical source. the solution above was presented here in the context of  
a particular deployment.

cheers,

kapil



More information about the Zope3-users mailing list