创建用户酶 - 干净的体系结构?
我在存储库中很有趣,
fun getDogs()=apiService.getDogs()
我的问题是我应该为此功能创建用例吗?换句话说,如果功能没有业务规则,我应该为其创建用户酶吗?
I have simple fun in repository it get all dogs
fun getDogs()=apiService.getDogs()
My question is should I create use case for this function? in other words if function doesn't have business rules should i create useCase for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据良好的编程实践,最好创建用例。用例将以两种方式受益:
如果您的用例非常简单,并且您很确定存储库层的合同永远不会改变(理想情况下是一件坏事),那么您可以使用存储库直接继续进行。
As per good programming practices, it is better to create a use case. A use-case will benefit in two ways:
If your use case is very simple and you are pretty sure that the contract from the repository layer would never change (which is ideally a bad thing to assume), then you may go ahead directly using the repository.