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

> Java can be very productive after the chosen framework "clicks" for you.

you can chose to not use DI frameworks at all..




DI buys you maintainability.

Without DI, there's too much flexibility in how objects get constructed. If you want to add new functionality to a legacy code base, it can be difficult to track down the different integration points and slow to plumb through your dependencies. These projects can turn into spaghetti very quickly.

DI solves this with a simple recipe: define your functionality, define your dependencies, wire it up to the injector.

The pattern is useful in all OO languages, Python and C++ included.


the problem is that those DI frameworks are all adding substantial amount of complexity and brain load.

I started using just static factories in my code, and abandoned all those DI and it works well enough.


  > I started using just static factories in my code, and abandoned all those DI and it works well enough.
i have done this as well (though not in java), it makes knowing what gets initialized how and where much easier and faster to debug




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

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

Search: