Lennart Regebro wrote:
On 11/9/06, Chris Withers <[EMAIL PROTECTED]> wrote:
I'm expecting people to say "NO!" very loudly, but I'm interested in the
real reasons for why this is bad.


Well.... it removes the possibility of switching out the class, which
begs the question why you would have an adapter in the first place. If
you have a strict one to one relationship between the class and the
adapter, why not just implemetent the desired functionality directly
in the class?

It's not one to one:

<adapter
    for=".myclasses.MyClassA"
    provides=".interfaces.ISomething"
    factory=".adapters.MyAdapter1"
    />

<adapter
    for=".myclasses.MyClassB"
    provides=".interfaces.ISomething"
    factory=".adapters.MyAdapter1"
    />

<adapter
    for=".myclasses.MyClassC"
    provides=".interfaces.ISomething"
    factory=".adapters.MyAdapter2"
    />

<adapter
    for=".myclasses.MyClassD"
    provides=".interfaces.ISomething"
    factory=".adapters.MyAdapter2"
    />

Re-use of adapters without having to create or use a mixin...

cheers,

Chris

--
Simplistix - Content Management, Zope & Python Consulting
           - http://www.simplistix.co.uk
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to