Ioc containers and dynamic languages ​​(take 2)

I read a lot about the dependencies of Injection, Inversion of Control, and IoC. I also primarily program dynamic languages ​​(PHP at work, Python at home). Here is what I find, but it leaves a lot of gaps for me to fill as I put it all together:

So what I'm reading: IoC containers are much more complex in static languages ​​because it is much easier to do DI in dynamic languages. But they also provide benefits far beyond DI, such as managing dependencies for you and eliminating the need to combine dozens of objects manually. And by the way, they are complicated, so do not try to do them yourself (but for PHP there are no good ones).

I feel that this information leaves me kind of ... stuck. What should I do with this? I work in a very large code base, with very complex dependencies (and probably with a strong need for refactoring, but with another parallel problem). We have worked very poorly on the implementation of DI so far, and I'm really trying to turn us in the right direction. There is simply nothing there regarding dynamic languages ​​and IoC (or at least IoC containers).

I’d rather show “manual bindings” to myself and worry about automating it in the container later, after I get a better description of the principles? Is it worth it to implement my own simple IoC container? Or is this advantage not ultimately worth the cost of PHP?

+5
5

PHP " Symfony" . ( - ) , Java Spring, PHP-. , .

+3

. IoC , , , .

IoC API/ .

, . , . ( , )

IoC . ( , )

. , , ..

IOC, , , .

, .

+1

, . , IoC . http://martinfowler.com/articles/injection.html

, , " ", . , , , , , , - , . , . IoC .

, , - , , .

0

DIC, , , , , : Bucket (https://github.com/troelskn/bucket). DI . Symfony , ( ).

0

, IoC / , , , . IoC MVC . ( ). . IoC DI Java, (Java PHP), . , , , .

IoC , ? ? ? PHP java, , , , XML, , .

IoC Alfresco (Document Management System). , JSF, Spring, Hibernate freemarker, , , , -, , , .

If you are developing a targeted application designed to serve one business model and only a few clients, then immersion in the flow of IoC will make things more difficult, but not easier.

Einstein said that things should be simple, but not simpler than they are.

0
source

All Articles