[Zope-dev] implementing zope.component 4.0

Lennart Regebro regebro at gmail.com
Mon Nov 30 17:14:10 EST 2009


On Mon, Nov 30, 2009 at 22:40, Gary Poster <gary.poster at gmail.com> wrote:
> Then to the multiadapter concern I raised, all my real-world examples of adapters are to adapt one object so it can be used in a certain way (to integrate with another kind of object).  Power adapters, for instance, adapt a plug (required interface) so it can plugged in to the wall (output interface).  Is there a common real-world example of this for "multiadapters"?

Yup. http://www.amazon.co.uk/Scart-Adapter-Switchable-Plug-Socket/dp/B00077DC6A

Audio + Video in: SCART out. :)

> Turned around, people know the term "singleton" and they do not know the terms "adapters" and "utilities".  "singletons" describe the huge majority of how we use these things.

True. For me utilities are tools. Like CMFs portal_whatever. But in
Zope3 even small stupid singleton objects are utilities in some cases,
and that is confusing for a beginner.

> That said, and to repeat, I mind "adapter" more than "utility."

But adapter is really what it is. OK, Multiadapters are evidently
complicated... But is it really so complicated that we should throw
away the commonly accepted GoF for what clearly are adapters? How is
it less confusing to call IFoo.instance(x,y) than IFoo.adapt(x,y) or
even IFoo(x,y)?

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64


More information about the Zope-Dev mailing list