No one writes classes that have only default constructors - on the contrary, there are many reasons to write classes, that do not have a default constructor. And those are very common and thus far from exotic.
Update 16:25:
I just found that further down in the reference docs they write "The Spring team generally advocates constructor injection as it enables one to implement application components as immutable objects and to ensure that required dependencies are not
null. Furthermore constructor-injected components are always returned to client
(calling) code in a fully initialized state."Yes, that's the way it is supposed to be (have been reading Joshua Bloch, haven't we?), but it totally contradicts the original statements...
Keine Kommentare:
Kommentar veröffentlichen