If a class has hard dependencies, in which the object is not valid
without them, then the constructor is the place for them. BasicDAO is
not valid with those fields. It is very clear from the constructors
which options are required, and in what combination. If there was a
no-args constructor it would be less-clear what is fields are required
and would result in an initial invalid and broken state.
My feeling is that if you want that, then you can copy the code for
yourself. It is not much code.
This seems like a spring issue, and not something that should be
changed, as I mentioned. The constructors are correct and appropriate.
If you want to build some sort of extension for spring to simply
configuration I'm all ears, but since I don't use spring I can't very
easily contribute. I'm happy to look at an extension project for
inclusion if someone comes up with one.
Just out of curiosity, how do you mark those as singletons?