[dev] [commits] Horde-Hatchery branch master updated. 2374bf4d0704a85d5ef81f88a9d9a5ef5dea0f15

Gunnar Wrobel p at rdus.de
Tue Sep 22 17:17:14 UTC 2009


Hi Chuck,

Quoting Chuck Hagenbuch <chuck at horde.org>:

> Quoting Gunnar Wrobel <p at rdus.de>:
>
>> The branch "master" has been updated.
>> The following is a summary of the commits.
>>
>> from: d44f2159acb7196e432ee6e3fb1588b0f655a51b
>>
>> 2374bf4... Added a trivial dependency injection framework named  
>> Horde_Provider.
>
> Gunnar - when you have had a chance to look at Horde_Injector, could  
> you say if there's anything Horde_Provider does that you think  
> Injector needs before you move things over to Injector?

As I only just started with the Provider I used in at a very few  
places so far. So there will be no pain in moving to the Injector. And  
I do like the Injector package as it is definitely *not* as bloated as  
some of the other frameworks I looked at. Well, probably depends on  
what you want to do with such a framework but the Injector looks  
pretty good for what Horde might need.

Within Horde_Provider I used some magic methods (__get(), __set(),  
__isset(), and __unset()) for convenience. The Injector currently  
offers getInstance() and setInstance(). Is there a specific reason for  
avoiding the use of __get() and __set()?

When working with interface names I agree that I'd rather use  
$injector->getInstance('Horde_Kolab_Server') than  
$injector->Horde_Kolab_Server.
Nevertheless the factory based Binder allows you to bind the instances  
to any name. And for the unit testing I find it convenient if you can  
use your mocks without requiring the use of a dependency injector:

   $injector = new stdClass;
   $injector->some_mock = Mock();

In any case the Injector should get a hasInstance() method. If you  
agree I'll add it.

> I am presuming a bit, but the injector code was worked over pretty  
> good by the guys that wrote it. I can put you in touch with them  
> also if you have questions on the design or needs that it doesn't  
> cover.

Other than the point mentioned above I'm really happy with the injector.

I wrote a short summary on how to use Horde_Provider with Horde  
(http://cvs.horde.org/co.php/framework/Provider/doc/Horde/Provider/usage.txt?r=2374bf4d0704a85d5ef81f88a9d9a5ef5dea0f15).
Do you think it makes sense if I adapt it to the Injector and add it  
to the package?

Cheers,

Gunnar

>
> Thanks,
> -chuck
>
> -- 
> Horde developers mailing list - Join the hunt: http://horde.org/bounties/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe at lists.horde.org
>




-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digitale PGP-Unterschrift
URL: <http://lists.horde.org/archives/dev/attachments/20090922/52378a95/attachment.bin>


More information about the dev mailing list