[Zope3-dev] Allowing views to be registered for classes rather
than interfaces.
Jim Fulton
jim@zope.com
Wed, 16 Jul 2003 13:10:59 -0400
Martijn Faassen wrote:
> Stephan Richter wrote:
>
>>On Tuesday 15 July 2003 08:07, Martijn Faassen wrote:
>>
>>>The point about the interface hierarchy is to allow multiple
>>>implementations of the same interface. Are the schemas described here
>>>designed with this in mind? Or does one really only ever expect a single
>>>implementation?
>>
>>That depends on what I am working on. Here I guess I meant that we only have
>>one implementation (which most interfaces will).
>
>
> I think it is odd that most interfaces will have only a single implementation.
> It shouldn't be that way; I think if something is to have multiple
> implementations an interface should be provided, but an interface
> should not really be necessary if you only ever expect one implementation.
I disagree. The interface bounds what users of an implementation can rely
on. It says how the clients and the implementation will be hooked up.
> You can argue a separate interface helps one clarify the structure of the
> code, but I don't really buy that; a class with docstrings works just as
> well. Having to maintain a separate interface in sync with the class is a
> bother and reminds me of C++ header files, which is not a good memory.
Well, we disagree then.
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