Hacker News new | past | comments | ask | show | jobs | submit login

Even in Python, you benefit from structuring an object to accept its dependencies as inputs, rather than calling to them by their global names. It lets you test each class independently with mock objects that support the same interface.



By writing XML config files? (or is that just a Struts wart rather than an intrinsic part of DI?)

Anyway - if mocking for tests is the major benefit of DI then there some other simpler ways to that. Everything I've read on DI makes it sound like a fairly complex beast.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: