[Zope-dev] improving the utility and adapter lookup APIs
Christian Theune
ct at gocept.com
Fri Nov 27 02:34:13 EST 2009
On 11/26/2009 10:48 AM, Martijn Faassen wrote:
> Thomas Lotze wrote:
>> Martijn Faassen wrote:
>>
>>> Thomas Lotze wrote:
>>> [snip]
>>>> What about a simple and consistent API for all components including
>>>> utilities, adapters and multiadapters:
>>>>
>>>> IFoo()
>>>> IFoo(x)
>>>> IFoo(x, y)
I like the interface being called to be the motion of doing "anything"
with the CA that doesn't expose the CA mechanics to application
developers as much.
>>> The last one won't work if we want to maintain backwards compatibility.
>>> The second argument is the default.
>>
>> Technically, that's obvious. I guess I meant to say "How about..." then.
>> You didn't explicitly mention the subject of backwards compatibility in
>> your original message, so let's make it explicit now: Is backwards
>> compatibility a goal in this discussion?
>
> True. It's indeed a goal, as I'd like to be able to use this sooner
> rather than later. If we break backwards compatibility then we'd have to
> go through all the IFoo() calls everywhere in all our code to see
> whether a default argument is in use.
Another option would be to provide a backwards-compatibility mode of our
code which can be switched on and off.
Your notion of bringing the component lookup mechanics closer to being a
"language feature" is very intriguing and I like it a lot. However, if
we do so, I'd like us to not having to resort to second-best
spelling/implementation due to backwards compatbility. I'd like to work
pretty hard on doing the implementation we want because it's a good
implementation and then make backwards compatibility work. (I know, I'm
a dreamer ...)
Christian
--
Christian Theune · ct at gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development
More information about the Zope-Dev
mailing list