Welcome Guest, Not a member yet? Register   Sign In
Poll: D.I. vs Service locator?
You do not have permission to vote in this poll.
yes
37.50%
3 37.50%
no
25.00%
2 25.00%
maybe
37.50%
3 37.50%
Total 8 vote(s) 100%
* You voted for this item. [Show Results]

True D.I. vs service locator.
#2

I messed around with Pimple a bit just out of curiosity. My question to you so I can  understand what exactly you are looking for is, how is attaching objects to the Pimple Container and passing it into the class any different than attaching the objects to the CodeIgniter "Super Object" and calling it directly ( get_instance()->my_library->do_work() ?) I understand for testing sending in mocks (when using DI) is a little easier but, it seems the CodeIgniter team has unit testing working regardless. Besides unit testing what other benefits am I not understanding?

As a side note:
I assume most dev's like me add a ci() function as a shortened version of the get_instance() function

DMyers
Reply


Messages In This Thread
True D.I. vs service locator. - by skunkbad - 04-09-2015, 10:19 PM
RE: True D.I. vs service locator. - by dmyers - 04-10-2015, 06:44 AM
RE: True D.I. vs service locator. - by skunkbad - 04-10-2015, 06:59 AM
RE: True D.I. vs service locator. - by dmyers - 04-10-2015, 07:09 AM
RE: True D.I. vs service locator. - by kilishan - 07-26-2015, 08:17 PM
RE: True D.I. vs service locator. - by mwhitney - 07-27-2015, 01:19 PM
RE: True D.I. vs service locator. - by kenjis - 07-27-2015, 02:33 PM
RE: True D.I. vs service locator. - by kilishan - 07-27-2015, 07:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB