I was reading about Spring core module and came across Spring annotations that I did not see till now in the Hybris project:
@Component,@Qualifier
Are these used in Hybris projects?
I was reading about Spring core module and came across Spring annotations that I did not see till now in the Hybris project:
@Component,@Qualifier
Are these used in Hybris projects?
Hybris 6.6 uses Spring 4.3. The usual annotations like @Autowired, @Required, @Controller, and many others should work.
If you have access to Hybris Help, have a look at "Spring Framework in SAP Commerce": https://help.hybris.com/6.6.0/hcd/8c63621986691014a7e0a18695d7d410.html
There is:
Hybris uses both. Annotation Injection and XML Injection. You can also use both. I recommend you, to define a clear strategy when you use which one.
For example:
Controller - Annotation Injection
Facade - XML Injection
Service - XML Injection
To your point, which kind of Annotation you should use, have a look here: What's the difference between @Component, @Repository & @Service annotations in Spring?
In common said, there is not really a different. It's just nice to use the correct Annotation for the correct class.