Especially on iOS it’s often necessary to create new objects like new view controllers or such things. This often cannot be avoided. This usually is solved by having the object that creates new objects also require all the dependencies of the objects it wants to create. This of course is not a great thing as …
Tag Archives: DI
Protocol Composition and Dependency Injection
I recently read the article “Using protocol compositon for dependency injection” by Krzysztof Zabłocki. I found this to be a rather interesting technique for doing DI, but when trying to implement it I found it somewhat limited: It doesn’t really handle dependencies that have dependencies themselves. No support for lazy instantiation, everything needs to be instantiated up front. …
Continue reading “Protocol Composition and Dependency Injection”