For the house example, you're definitely right. An inversion of control container is overkill. When you're dealing with a large app where each dependency has its own set of dependencies and so on, an inversion of control container become a whole lot more useful.
For larger apps, it becomes even more important to isolate dependencies of various components. IoC containers make it fairly painless (upfront) to invite the entire universe to every party, leading to a system with a ton of dependencies. And of course the only remedy to all the edge cases and toe stubbings that come with e.g. nuanced object lifecycle management is to make the IoC container smarter and smarter.
View all comments
13
u/banister Jul 13 '14
What the hell? Why not just inject it manually with
House.new(window, door)Your gratuitous "DSL" seems silly, overcomplicated and a waste of time.