[Grok-dev] Dynamic Adapter Registration

Jeroen Michiel jmichiel at yahoo.com
Sat Feb 7 16:40:55 EST 2009

OK, perhaps my understanding of the correct terminology wasn't quite exact
I want the adapter factory to be configurable, so that the adaptation can
happen in different ways.
But I solved my problem in another way: instead of trying to register
objects as adapter factories, I created just 1 class as adapter, but which
now adapts an extra configuration interface. So I have a multiadapter now
adapting IA and IConfig (to stay with my previous definitions) and providing
IB. And by passing different objects providing IConfig, I get my
configurable adaptation.

What got me confused, is that what is generally refered to as an adapter
actually seems to be the resulting object, while I saw the term adapter as
the one doing the adaptation, which is typically the adapter factory
function or the class on which you use grok.adapts. So what I really wanted
to do was use objects as adapter factories. And with them being persistened
I meant that these objects where persistently registered as adapter
factories. But I solved it differently. (I once read: if things get too
complicated, add another level of indirection, which is in some way what I
did, here)

Thanks for the replies, though, as it helped me get a better insight!

The tip about annotations is a very good one though, thanks!

View this message in context: http://www.nabble.com/Dynamic-Adapter-Registration-tp21869966p21893125.html
Sent from the Grok mailing list archive at Nabble.com.

More information about the Grok-dev mailing list