java – 我什么时候应该使用@Component而不是@Service?
我已经阅读过What’s the difference between @Component, @Repository & @Service annotations in Spring?中的每个Spring注释
我知道@Component和@Service在Spring Framework中几乎一样.差异与它的用法有关,所以我只是将@Service用于我访问我的存储库的服务层.
我想知道选择@Component而不是@Service的更好方法是什么.请注意,我现在正在为我创建的工厂使用@Component,因为工厂不需要处理存储库.