[Zope3-dev] Allowing views to be registered for classes ratherthan interfaces.

Jim Fulton jim@zope.com
Fri, 18 Jul 2003 13:32:00 -0400


Garrett Smith wrote:
> Martijn Faassen wrote:
> 
>>Questions:
>>
>>IFoo is going to be where? Which import statement from where? There's
>>also an __implements__ line you need to maintain. This is definitely
>>more overhead and things you can do wrong than just remembering how
>>to spell nonce. :)
> 
> 
> Were it me, I'd throw the interface into the same module -- I'm an XPish
> fan, so I like to get things working then evolve.

Yup. As this discussion proceeds, I'm becoming convinced that
interfaces that are expected to have a single implementation should
live close to their implementations.

I'm working on refactoring the zcml implementation right now. I have
a situation where an interface has several implementations, but, they
are so closely related thay they live in the same module. I'm putting
the interface in the same module with the implementations.  Interestingly,
I'll never use this interface in zcml. It's not going to be used to hook
anything up. It's just there to help me reason about what I'm doing.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (703) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org