Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

No, you can pass (inject) the necessary dependencies to the constructor of an object at creation time, and then simply use that object instance everywhere. The only thing frameworks do is "solve" the dependency graph and instantiate stuff in the correct order.

This is also the most common/preferred way Spring et alia implements their "framework-aided" DI, so that you can write unit tests easily without bootstrapping a Spring context (and it is just well-designed vanilla Java code).



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

Search: