I'm exploring dependency injection and trying to make the exercise as pythonic as possible; existing dependency injection frameworks seem very java-like. I've made some pretty good progress building my own framework, but I could really use a model project to validate the framework against. An ideal suggestion would be something that is hard without dependency injection, but is otherwise conceptually trivial.
Tell me more
×
Programmers Stack Exchange is a question and answer site for
professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.
|
|
The reason most dependency injection frameworks are Java-like is because Java is not a dynamic language. At least for unit testing in dynamic languages, stubbing and mocks are just as useful in Python as dependency injection. Arguably more so, since they don't force you to adopt a more-complex-than-necessary design. For things other than dependency injection, the answer changes. But if you have no problem to solve, why are you writing code? Isn't it better to start with a problem to solve, and then work on a solution? |
|||
|
|