On Thu, Feb 27, 2014 at 12:44 PM, Marco Pivetta <ocram...@gmail.com> wrote:

> Not really. That abstract factory just relies on a "Config" service (that
> is an array or ArrayObject) - it does not depend on Mvc components.
>

Okay, I'm understanding this "Config" service a little more. I was under
the impression ServiceManager\Config would automatically configure all its
sub-components with the config data passed in. I don't really see how this
is an invalid assumption, though.


I'll look into it, too, but this is a new piece to me I just discovered
>> today -- seemed to fit my needs (I have 3 different db adapters I need to
>> manage ... owie!). And I don't know all the potential implications or
>> thought-process around the design decisions for abstract_factory. At the
>> base, abstract_factory needs to become config aware upon
>> $sm->addAbstractFactory().
>>
>>
> Not sure what you mean here...
>

At the point of adding abstract factory classes to the ServiceManager, it's
a reasonable assumption you would be passing in itself or the defined
configuration. However, I have seen the ambiguity on my part:
AdapterAbstractServiceFactory under Zend\Db needs a 'db' key to be defined,
which wouldn't be under the 'service_manager' sub-key. Adding complexities
when having to discover 'db' location from outside of the ServiceManager
package.

I did find a solution now, however:

My config file actually already had a config service defined:
...
    'services' => [
        'app.config' => [
           // .. Add my application configs here.
        ],
    ],
...

Just changing the name to 'Config' actually worked. ;)

It would be nice to add in the documentation, then, for the Db
AbstractServiceFactory, it is dependent on a 'Config' service of some type,
whether it be a factory service, or just a 'services' => 'Config' => [] in
the config file.

---
Philip
g...@gpcentre.net
http://www.gpcentre.net/

Reply via email to