[z3-five] Re: Conundrum: parse time validation vs. on-the-fly
creation
Philipp von Weitershausen
philipp at weitershausen.de
Tue Aug 3 11:33:11 MEST 2004
Tres Seaver wrote:
> Damn! I just added a new directive, '<five:bridge>', which works
> brilliantly: it creates a Zope3 interface from a Zope2 interface, and
> seats it into a module. The problem is that, used in ZCML, you can't
> both create the interface (via 'bridge') and then bind it (via
> 'implements'), because the validator for 'implements' can't find the
> not-yet-created interface at parse time.
>
> Any notions about how to address such a problem?
Martijn and I had a similar problem with XMLSchemaInterfaces which were
marker interfaces for XML content whose id was simply a URI. You had to
define them in ZCML first and then you could use them, only that they
didn't exist yet because the actions weren't processed.
The whole action mechanism is there to allow conflict resolution based
on descriminators. I would suggest to carry out the interface conversion
and placing into the module immediately, without deferring to an action,
but still issue an action with a dummy callable but meaningful
descriminators. That way ZCML will still barf when you bridge an
interface more than once, but the interface will be in the module right
after you've called <five:bridge>.
Philipp
More information about the z3-five
mailing list