[Zope3-dev] N-Tuple Adapters
Steve Alexander
steve@cat-box.net
Tue, 03 Jun 2003 10:18:21 +0300
> An n-tuple adapter registry is the digital version of
> MacGuyver: you have a chess board, a clothesline, a match, and shoes.
> How are you going to start that car? ;-)
So long as you know in what order MacGuyver would order that tuple .
> I've been thinking about ways to deal with this, but I'd like some input
> on the general idea first. Do you think n-tuple adapters would be
> generally useful?
Well, I can think of uses up to two- or maybe three-tuple adapters.
> Is there a way to think about them that would reduce
> or eliminate the deep search?
Have a smart registry that "expands" a single registration into all of
the other registrations that it implies.
This would be a way of providing "transitive adaption" too. That is, if
I can adapt A->B and B->C, the system should allow me to adapt from A->C.
> Is there any research on this topic or something similar?
Multimethods? http://c2.com/cgi/wiki?MultiMethods
Multiple dispatch? http://c2.com/cgi/wiki?MultipleDispatch
http://c2.com/cgi/wiki?ExternalPolymorphism
http://c2.com/cgi/wiki?GenericFunction
http://www.cs.wustl.edu/~cleeland/papers/index.html
http://www.cs.washington.edu/research/projects/cecil/www/Papers/dispatching.html
The perl Class::Multimethods module
http://search.cpan.org/author/DCONWAY/Class-Multimethods-1.70/lib/Class/Multimethods.pod
http://www.onlamp.com/pub/a/python/2003/05/29/multimethods.html
I'll stop there :)
--
Steve Alexander