[Zope] Newbee interfaces and implementations

bruno modulix bruno at modulix.org
Wed Jan 18 14:32:01 EST 2006


Roman Klesel a écrit :
> bruno desthuilliers schrieb:
> 
>>Looks like you're newbie to OO too !-)
>>
>>A class defines a type. You then need to have an instance of that type
>>(like, say, 42 is an instance of type integer and 'foo' is an instance
>>of type string).
>>
> 
> 
> Yes, true! :-)

!-)

>  > (Interfaces (I mean, 'explicit' interfaces) defines an 'abstract' type,
> 
>>that can be implemented by many classes. With Python's dynamic typing,
>>you don't *need* explicit interfaces - at least with Zope 2.x. AFAICT,
>>the recommandation to use explicit interfaces is mostly about Zope3
>>relying on them to implement some nice features).
>>
>>So it would be:
>>
>>tal:define="some_name context/myObject/doThis"
>>
>>As you see, you don't have to worry about interface at this level...
> 
> 
> So you recommend that I should just skip them as long as I'm on Zope2?

Short answer :  yes. Unless you plan to switch to Zope3 really soon, but 
then, I'd recommand that you skip Zope 2.x !-)

> I would be happy with that. I find them confusing when they don't
> really interface with but just document my methods.

The Interface package offers much more than simple documentation. But I 
don't think you will find much Zope 2.x code using it.

My 2 cents


More information about the Zope mailing list