Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于domainservice应当如何理解? #447

Open
xiaohan759 opened this issue Sep 3, 2023 · 1 comment
Open

关于domainservice应当如何理解? #447

xiaohan759 opened this issue Sep 3, 2023 · 1 comment

Comments

@xiaohan759
Copy link

请问一下官方示例中domain层的domainservice包下有一个CreditChecker类,并没有交给spring容器进行管理,应该如何理解domainservice?并且领域实体是充血模型,那么check方法是否可以放在Credit类中,那么两者又有什么区别?

@felix9ia
Copy link

+1,我目前的理解是 app 层重复性很高的,可以下沉到 domainservice 来做,然后app层调用这个 domainservice ,至于是否交由容器管理,不必在意,如果 domainservice 有依赖其他的 spring bean ,就直接一个@component 上去!

说实话,官方的例子太少了。。。

我现在都不知道 domain 层的 ability 到底能写一些什么逻辑,ability 和 充血后的entity 和 domainservice 它仨的区别是啥?entity 和 model 的区别又是啥?

拿 user 举例:
entity 充血之后,ability 和 domainservice 还有用吗?
该不该有 UserEntity,和 UserModel 这两种东西?还是说 entity 就是 model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants