[dev] Injector musings
Michael Rubinsky
mrubinsk at horde.org
Mon Aug 30 22:00:24 UTC 2010
Quoting Chuck Hagenbuch <chuck at horde.org>:
> Quoting Gunnar Wrobel <p at rdus.de>:
>
>> Concerning the Horde_Editor factory: The only thing I'd tend to
>> change would be to modify the binder so that it is bound to
>> 'Horde_Editor_Factory' (as it does not directly deliver a
>> 'Horde_Editor' object). You could create a Horde_Editor_Factory
>> class in the Horde_Editor package though that might make things
>> more complicated as this probably should not have knowledge of
>> Horde_Browser and the Horde configuration (which
>> Horde_Core_Factory_Editor currently has). Maybe
>> Horde_Editor_Factory should just be an interface that is being
>> implemented by Horde_Core_Factory_Editor.
>
> I wanted to second this point. There are a number of injector
> bindings right now which give you back a factory when you haven't
> actually asked for it - asking for a Horde_Editor object should give
> you a Horde_Editor object (or an error), not a factory. If we need a
> factory we should be asking for it.
While we are on the subject, aren't some of these Factories more like
Singletons? Or is this distinction not important for our purposes here?
--
Mike
--
The Horde Project (www.horde.org)
mrubinsk at horde.org
"Reality is merely an illusion, albeit a very persistent one." - A. Einstein
More information about the dev
mailing list