[Zope-dev] implementing zope.component 4.0
charlie.clark at clark-consulting.eu
Mon Nov 30 15:49:46 EST 2009
Am 30.11.2009, 20:24 Uhr, schrieb Gary Poster <gary.poster at gmail.com>:
> 1) I very much like the idea of some helpers hanging around. However,
> my current belief is that the factory "methods" ought to be callable
> objects that allow introspection of the underlying registry. That's
> where the "lookup" style behavior belongs, IMO, as well as other
> helpers. See below for examples.
> 2) As argued before, I think that "adapt" is an ok name for a single
> object, but becomes a bad name once you have "multiadapters" in the
> mix. I would prefer one of the options Matthias Lehmann proposed ("new"
> for instance).
I have no great problem with multiadapters as long as the analogy is clear
enough - "this adapter takes two sources..."
> 3) I also think that "utility" is a bad name. Is "singleton" two
> letters too long? If it is, I mind "utility" less than I mind "adapter".
I don't understand this. For me a singletons is (sic) a highly specific
programming term whereas adapters and utilities, especially in the way we
refer to them, are not so domain specific.
> IFoo.new(a, b) # finds and returns result of call
> IFoo.new.lookup(IA, IB) # finds and returns callable
> IFoo.new.find(IA, IB) # get all registration information
> IFoo.new.find_stack(IA, IB) # get an iterable of the stack all
> registration information for each registration for those two interfaces
> IFoo.singleton() # finds and returns item
> IFoo.singleton(name='baz') # finds and returns item
> IFoo.singleton.lookup(name='baz') # same result in this case
> IFoo.singleton.find(name='baz') # get all registration information
Interestingly this is starting to look too verbose and java like to me but
I'm also not happy with the use of "new" or "singleton". "find" might be
an idea if it could use introspection to gives clues as to what I might
actually want to do with my IFoo implementers. Can you give some sample
> Side, but related point:
> I wonder if there is value in the ability to spell
Could someone please point me in the direction of the definition of this
use of spell? Is it short for "spell it out"?
Clark Consulting & Research
More information about the Zope-Dev