Martin Aspeli wrote:
Martijn Faassen wrote:
Oh, I disagree. It's much nicer to be able to be able to start with
adapting classes, and introduce interfaces later, where necessary. Often
they're not. In fact it's already possible to adapt classes and register
views for classes. In ZCML I
Martijn Faassen wrote:
Martin Aspeli wrote:
Martijn Faassen wrote:
Oh, I disagree. It's much nicer to be able to be able to start with
adapting classes, and introduce interfaces later, where necessary.
Often they're not. In fact it's already possible to adapt classes and
register views for
On 11/9/06, Jean-Marc Orliaguet [EMAIL PROTECTED] wrote:
Lennart Regebro wrote:
On 11/9/06, Chris Withers [EMAIL PROTECTED] wrote:
Why do you say extra ZCML registration? You need that ZCML
registration whether or not you have to write the marker interface...
Sure, but with the marker
Hi All,
I find myself often having to define pure marker interfaces for each
class that I define, purely so I can register adapters for objects of
that class.
How do people feel about:
- being able to register an adapter as follows:
adapter
for=.myclasses.MyClass
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.
On 11/9/06, Chris Withers [EMAIL PROTECTED] wrote:
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
Sorry about the premature sending, I don't know what button I pressed...
Here we go again:
So instead of making a marker interface, which is two lines of code,
and two registrations, a total of six lines (with the imports), you
have an extra ZCML registration statement, which is three lines of
On 11/9/06, Chris Withers [EMAIL PROTECTED] wrote:
Why do you say extra ZCML registration? You need that ZCML
registration whether or not you have to write the marker interface...
Sure, but with the marker interface you need only one. You need one
for each class, in your example, thats two. So
Chris Withers wrote:
Hi All,
I find myself often having to define pure marker interfaces for each
class that I define, purely so I can register adapters for objects of
that class.
How do people feel about:
- being able to register an adapter as follows:
adapter
for=.myclasses.MyClass
Jim Fulton wrote:
adapter
for=.myclasses.MyClass
provides=.interfaces.ISomething
factory=.adapters.MyAdapter
/
I think it is a fine idea. That's why it has been supported for
a long time. You can register adapters and views (which, of course
are adapters) for classes as well
Martin Aspeli wrote:
Chris Withers wrote:
I find myself often having to define pure marker interfaces for each
class that I define, purely so I can register adapters for objects of
that class.
Why does your class not have a (non-marker) interface in the first place?
The use of interfaces as
Chris Withers wrote:
Jim Fulton wrote:
adapter
for=.myclasses.MyClass
provides=.interfaces.ISomething
factory=.adapters.MyAdapter
/
I think it is a fine idea. That's why it has been supported for
a long time. You can register adapters and views (which, of course
are
Chris Withers wrote:
Jim Fulton wrote:
adapter
for=.myclasses.MyClass
provides=.interfaces.ISomething
factory=.adapters.MyAdapter
/
I think it is a fine idea. That's why it has been supported for
a long time. You can register adapters and views (which, of course
are
On Thursday 09 November 2006 10:02, Chris Withers wrote:
...will work, right?
import zope.component
class A(object):
... pass
...
class B(A):
... pass
...
import zope.interface
class ISomething(zope.interface.Interface):
... pass
...
class BToSomething(object):
... def
Lennart Regebro wrote:
On 11/9/06, Chris Withers [EMAIL PROTECTED] wrote:
Why do you say extra ZCML registration? You need that ZCML
registration whether or not you have to write the marker interface...
Sure, but with the marker interface you need only one. You need one
for each class, in
Martin Aspeli wrote at 2006-11-9 04:37 -0800:
...
Why does your class not have a (non-marker) interface in the first place?
The use of interfaces as documentation and as formalisms for expressing a
class' functionality (in adapters, utilities etc) is one of the benefits
that Zope 3 introduces. I
16 matches
Mail list logo