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

I agree on the benefits of the first example but is that really dependency injection? Or is it just an abstraction layer?

eg. what if getAccount was hard coded to initialize all the other dependencies it needed on the fly for each call?

If that's still considered DI then it's a much looser term than I understood it to be.



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

Search: