[PEAK] Re: gf.when() doesn't honour Interfaces on instances (protocols.adviseObject)

Ulrich Eck ueck at net-labs.de
Thu Dec 2 13:44:46 EST 2004


> >this originates from the idea to be able to use *one* implementation for
> >peak- and z3-component based systems (z3 with their interfaces-impl).
> 
> Well, you *can* do that , you'd just have to do the heavy lifting yourself 
> in a custom __conform__.  Personally, I think using interfaces to represent 
> state is, well, odd at the least.  An interface expresses a contract, but 
> what is the contract of a state?  State is part of implementation, IMO, not 
> part of the interface.
> 
> However, I think this is part of a systemic design bias in Zope towards 
> viewing objects as dumb "content", and putting the behaviors in other 
> objects that examine the "content" to decide what to do with it.  I think 
> this perspective leads to flawed encapsulation, and makes it harder for 
> people to extend the framework because they then have to fake metadata to 
> convince the behavior objects to do what they want, when if the behavior 
> were on the content object to start with it wouldn't be an issue.
> 
> (Actually, another design issue that's in play is the Zope preference for 
> adapters to adapt from interface to interface, instead of implementation to 
> interface.  I heard at one point they were going to allow class->interface 
> adapters, but I'm not sure if that ever materialized.)

i'm still finding my way into GenericFunctions and how to use them to
build statemachine-like workflows - so i'll drop the "code once use
everywhere" requirement for now - as all my software is written in peak
- there is no problem ;-)

i agree with what you state above.

Ulrich




More information about the PEAK mailing list