[Zope3-dev] Re: Allowing views to be registered for classes rather than interfaces.

Shane Hathaway shane@zope.com
Tue, 15 Jul 2003 10:46:42 -0400


Martijn Faassen wrote:
> I'm forced to create an interface for just about any object otherwise
> it won't play along with the component architecture. Normally I'd 
> want to wait until I create interfaces until the problem is clear, but
> now I need them as I need to provide, say, a view. I'm not that
> good at abstract design.

Well, I'm with you there.  I don't write an interface until I have a 
complete, cohesive picture of what it will do.  Sometimes that means I 
have to write an implementation first.  Sometimes it's so hard that I 
have to write several implementations before I'm sure of the interface. 
  Correct foresight comes only with experience.

However, wouldn't it be sufficient to start with a marker interface? 
Here's one way we might spell it:


class IThingamabob(Interface):
     """TBD"""

class Thingamabob:
     implements(IThingamabob)


In this case, I think it would be best to break the "interfaces.py" 
convention and put the interface next to the class.

Shane