call service vs dao from another service

前端 未结 2 645
夕颜
夕颜 2021-02-06 07:10

I have User And Role entities and Service, DAO layers for them. I need Role list from UserService.

Which layer should I use from UserService? Call list

2条回答
  •  名媛妹妹
    2021-02-06 07:40

    Call the list method in the RoleService.

    The business logic around Roles may change one day and all changes in the RoleService to handle that will be useless for all code calling the DAO directly.

提交回复
热议问题