在持久层、业务层和控制层分别採用 @Repository、@Service 和 @Controller 对分层中的类进行凝视,而用 @Component 对那些比較中立的类进行凝视

这里就是说把这个类交给Spring管理,又一次起个名字叫userManager,因为不好说这个类属于哪个层面。就用@Component

相关文章:

  • 2022-12-23
  • 2022-01-14
  • 2021-06-05
  • 2022-02-03
  • 2021-07-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-07
  • 2022-12-23
相关资源
相似解决方案