Roman Klesel wrote:
> I'm in the process of learning to develop fs-zope-products.
> The developers guide recommends to write interfaces and implement them in
> classes. Now my question:
> When I have an interface:
> with several methods:
> and I have an implementation:
> How will I then access the methods e.g. in a Template?
myObject = DoThingsClass(any_args_here)
> Through the interface:
> or through the implemantation:
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).
(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:
As you see, you don't have to worry about interface at this level...
> I would think the first one should be the case.
And you would be wrong.
> Please shed some light on me!
Hope that does...
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists -