Hacker News new | ask | show | jobs
by calebm 2884 days ago
Dependency injection scares me as it feels like a move towards the JavaEE/Spring world.
3 comments

Having used other DI systems, I think the parts that most confused me were that the injector would usually be hidden away (meaning you couldn't see _what_ was being injected), and also the conflation with various initialization patterns (factories, providers, singletons).

In Fusion.js, the injectable registration is done in the entry file, and initialization patterns are the concern of the service API. I think these design choices simplify things a lot.

Me too.

The increase in complexity and lack of visibility from a DI system, vs what the manual wiring code would look like, can be immense.

Nah, we already had it on the COM/CORBA world.