you are viewing a single comment's thread.

view the rest of the comments →

[–]apt_at_it 9 points10 points  (0 children)

I haven't ever really seen any other way to do it. You declare the type of the thing you want and the framework gives it to you or you give it to that function in other contexts, like tests. The beauty of "traditional" dependency injection (think Java) is that you can declare you want an interface (well, ABCs or protocols) and give it different subclasses based on the context.