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

You can do dependency injection without a DI framework/container, just declare the required dependencies for a class as required parameters in the constructor and build your own dependency tree manually when constructing the objects in `main()`-equivalent.

Using a DI container is not required to implement the DI pattern, it's just a tool that facilitates some more complex DI.

I tend to prefer to keep my projects simple enough that manual DI is quite appropriate and readable.




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

Search: