Legacy Refactor Question: What About Singletons?

Posted by Unknown on Tuesday, June 3, 2014

In my talk and my book on refactoring legacy PHP code, one of the early steps is to start removing globals and replace them with dependency injection (not a container, just injecting dependencies by hand.) I addressed the use of the global keyword and the $_GET (et al) superglobals, but I did not address singletons directly. I had a Reddit correspondent ask about singletons recently, and how to refactor away from them; I answered on Reddit, where you can read the full conversation.




more

{ 0 comments... » Legacy Refactor Question: What About Singletons? read them below or add one }

Post a Comment

Popular Posts