What is the difference between anotate @Autowired to a property or do it in the setter?
As far as I know they both have the same result, but is there any reason to use o
There is one case where using @Autowired on an OPTIONAL property would not work.
If you want to do some initialization using that property, it might not be set before the constructor is called, and since it is optional, you cannot put it as an argument in the constructor.
In that case it is better to use an @Autowired setter method, so you can perform the initialization once the property is autowired.