Hello,
I'm new to the spring framework and I've got a question:
When I want to use Dependency Injection, why is it so important that the classes whose properties get injected have a default constructor? I can understand that setters are needed, but I don't know why there must be a default constructor, because aspects should be able to wrap around any constructor, not just the default ones (in AspectJ, you can use wildcards for parameter lists and so on).
Is there any special reason? Or does some way exist to use Dependency Injection with a class that has only parameterized constructors? In my case, there are some classes where it wouldn't be a good thing to offer default constructors.
Thanks in advance
ZeHa


Reply With Quote