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

拜读了代码,业务逻辑感觉主要集中在领域服务里domain/service? #6

Open
richard2018 opened this issue Feb 21, 2019 · 1 comment

Comments

@richard2018
Copy link

拜读了代码,业务逻辑感觉主要集中在领域服务里----domain/service?领域对象本身还是没有承载业务,还是setter/getter的贫血模型,这样的代码结构感觉和普通事务脚本(service/dao)似乎没有本质差别呢?这可能算是ddd战术实现的另一套方法了

@JoeCao
Copy link
Owner

JoeCao commented Feb 21, 2019

因为这是一个demo项目,为了简化,很多常规业务流程没有做(比如用户注册绑定手机、订单支付、订单取消等等)。demo核心业务逻辑主要集中在意向单和司机的匹配上,这正是Intention领域的逻辑,很多方法都在Intention这个根对象上面体现出来了。
https://github.com/JoeCao/qbike/blob/master/intention/src/main/java/club/newtech/qbike/intention/domain/core/root/Intention.java
你看所有的候选司机都是在这个根对象里面的,就是为了方便做匹配的业务逻辑,这是一个典型的充血模型。
对于其他的业务逻辑,可以自行扩展。分析哪些方法在根对象中,主要是用“Event Stoming”、“贴身职责”的方式来进行。

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