Spring dependency injection
The other day while coding some spring beans I had a question. Which method of depedency injection should be used (constructor or setter). One of my coworker had a good reasoning.
If you feel that something is absolutely needed then inject them through a constructor. If it is optional then user a setter injection. In Spring the default way is to use setters for dependency injection.