知识卡片
成功响应丢失会重做
即便只修改一条记录,调用者和数据库也可能对执行结果认知不同。访问计数已经加一,但响应丢失或进程在调用方记录成功前崩溃,调用方重试就会重复加一。void方法同样通过正常返回或异常表达结果;单条写入的原子性并不等于整项操作可安全重试。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- 实现简单业务逻辑 · 查看原书依据
Although the execute method is of type void, that is, it doesn’t return any data, it still communicates whether the operation has succeeded or failed: if it failed, the caller will get an exception. What if the method succeeds, but the communication of the result to the caller fails? For example: If LogVisit is part
参考来源
- 位置:《Learning Domain-Driven Design》第5章《实现简单业务逻辑》(来源项目:book-sources;源文件:extracted/Learning Domain-Driven Design/_epub-src/OEBPS/ch05.html)
- 结论依据:原文对该概念的定义、应用条件及相邻概念的比较支撑本卡解释。
- 原始内容:Although the execute method is of type void, that is, it doesn’t return any data, it still communicates whether the operation has succeeded or failed: if it failed, the caller will get an exception. What if the method succeeds, but the communication of the result to the caller fails? For example: If LogVisit is part