[Zope3-dev] "common" or "basic" interface types?
Mike C. Fletcher
mcfletch@rogers.com
Wed, 12 Mar 2003 23:06:23 -0500
Wondering if anyone can point me at where in Zope3 I can find the
Interface definitions for the various "simple" types:
* string, unicode (ISliceable, IIterable, IGetIndexable,
IFindStringable, IStringInterpolatable, IStringConcatenable,
IEtceteras)
* list (IReverseable, IAppendContainer, IInsertByIndexContainer,
IEtceteras)
* dictionary ...
* function, method, class, module ...
* ...
I'm looking at adopting the Zope interface mechanism for my GUI
application-development library, and figure that I will eventually want
these interface-types. Since I would like to keep the duplication of
effort and incompatibility to a minimum, I would like to use the same
interface declarations as Zope, but I don't see where in the interfaces
package they would logically be stored.
Secondary question:
When declaring an interface-set for a base-type object (one which
cannot be directly modified to declare its interfaces), where what
you want to say is: I can make this type act like it has this
interface via an adapter. Is this the proper way to go about it:
* For the relevant sub-elements of the base-object's interface,
define a Interface object, and register the object as
providing that interface with the "hands-off" mechanism in the
registry. (In many cases, the "relevant" portion of API seems
to be "it", as higher level interfaces are defined in terms of
accepting these low-level object types. Arguably you can
separate out (with some work) which particular features of the
low-level object are being used, but that might require
tracking the value through the entire application, which seems
silly for primitive types).
* Define an adapter object which implements the desired
interface by directly accessing the base object to provide the
functionality (how does the adapter get the pointer to the
object BTW?)
* Register the adapter object (or adapter class?) as adapting
the desired interface to the base-type object's interface.
Is there supposed to be another interface defined/supported for the
adapter object itself?
Pointers appreciated,
Mike
_______________________________________
Mike C. Fletcher
Designer, VR Plumber, Coder
http://members.rogers.com/mcfletch/