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

That is correct that the libraries should not have DI but I should be able to wire up the library on my own and not let the library do its own static initialization. What is far worse than Class.forName and other crap is libraries self imposed singletons.

Take for example Hystrix. I'm just now fixing that the thing loads up its own configuration framework (Archaius) which uses static initialization. Archaius needed like 10 other dependencies. This is all really because Hystrix uses static singleton (HystrixPlugins) and many frameworks need this or else is incredibly difficult to get an implementation up (ie using pseudo singleton to avoid excessive passing of a context).

https://github.com/Netflix/Hystrix/pull/1083



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

Search: