[Zope-dev] implementing zope.component 4.0
Martin Aspeli
optilude+lists at gmail.com
Tue Dec 1 10:53:40 EST 2009
Martijn Faassen wrote:
> Joachim König wrote:
> [snip]
>> To me the fact that an object "is" a singleton or a factory is
>> orthogonal to the registry stuff.
>>
>> Why can't utilities be factories too that simply return themselves when
>> being called? Then being
>> a singleton or not would be in the responsibility of the registered
>> object (class, factory, singleton)
>> and the ZCA would not need to know.
>>
>> What am I missing (except bbb)?
>
> I don't think you're missing anything. It's just that others have a
> different perspective on this than you and me.
Clearly, it could. But that's not the way we went. Changing it now would
be really damaging, and I'm not sure what would be gained.
I can imagine use cases where getting a new instance each time would be
useful. I can't say I've ever actually needed it, though. If it's
something that can be done without breaking existing code or requiring
the rewriting of history on patterns we've encouraged and documented to
date, it'd certainly be an interesting option to explore.
Martin
--
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book
More information about the Zope-Dev
mailing list