3 ms·
Mainly because once you get more than a few arguments, it gets tedious to start newing them all up and all of their dependencies and on down the stack. So some
by kamarg 8y ago
Mainly because once you get more than a few arguments, it gets tedious to start newing them all up and all of their dependencies and on down the stack. So some people built frameworks to do it for you but each of these frameworks requires their own configuration/documentation and suddenly instead of 50 lines of news, you have annotations in twenty different files that effect the way your code runs without actually being code. Each step to get from A to Z seems perfectly logical but the end result is a difficult place to start.
- vbsteven 8y agoIt's only a problem if you let it become a problem. Just like with code style, naming and formatting, the DI configuration should be enforced during code review. Spaghetti code would not pass code review, so why would you allow spaghetti configuration. In the code bases I work in I know if I need to know what Logger is injected I need to look at the LoggerConfiguration class to see which Logger implementations are used in production, staging and dev. And even if I don't know the name of the LoggerConfiguration file, I have an IDE that can get me from injected property to configuration in one click.
- sharemywin 8y agoBut, your experienced in your teams code. Now, let's say you and your team get fired except maybe some person on another continent they hired to keep it up. OK, 20 years from now. Your reincarnated and you just got hired to dig through the code and you've hard of java, but nobody uses that relic anymore.. Good luck. That would be a fun text adventure....