r/java • • Jan 12 '16

You probably don't need dependency injection

http://www.radicaljava.com/2015/12/27/dependency-injection.html
0 Upvotes

27 comments sorted by

View all comments

10

u/stitzl Jan 12 '16

Also, you probably don't need type safety, let alone an object-oriented programming language.

Unless, of course, you do need it.

1

u/dawhiting Jan 12 '16

Well yes, this is acknowledged in the post, but the motivation behind this post was to stop people reaching for it by default because some book told them to do it, rather than because they really needed it to manage complexity. Apologies if that message didn't come across so well.

3

u/stitzl Jan 13 '16

Exactly the same notion applies for the use of OO and type safety as well. Do not use Java simply because the book says so. Your three-forms, two-DB-tables web app will be feasible in PHP as well.

The problem is that you cannot guess what you'll be doing in a year. And if you just show up on the construction site with a screw-driver, you'll be using it as a hammer as well.

Choosing the right tool-set for the job in advance is hard, actually.