I've a decent amount of OOP with various languages but am pretty new to Java.
I'm reading through a lot of tutorials where large numbers of objects are created within the code of a class, and I'm trying to run through them but build versions of the classes in the tutorials that do Dependency Injection instead of instantiating all the classes themselves.
But Java is not like other languages I've used in that pretty much everything is an object. If I was to literally inject everything then the result would be very messy and hard to follow.
Obviously you wouldn't inject String objects, and I'm guessing there are other objects you wouldn't inject, but I'm not sure where the line should go. At what point does DI stop being the right thing to do, and when does it start being a burden? How do you decide pragmatically what to inject and what to just instantiate?
FYI, the tutorials I'm doing are http://edn.embarcadero.com/article/31995 and http://docs.oracle.com/javase/tutorial/networking/sockets/clientServer.html for building a simple client and server. I'm not copying them line for line though, I'm trying to create equivalent classes that follow best practice