具有 DDD 的工作流基础
我很好奇是否有人将工作流基础应用于 DDD 项目,如果是的话,陷阱/陷阱是什么。
我正在研究一个极其复杂的状态流程,看起来 WF 很适合,但我正在尝试确定如何将工作流程与操作域模型的状态隔离开来。有人建议我建立一个像样的反腐败层,然后从那里开始。
其他人有这方面的经验吗?
I'm curious if anyone has applied workflow foundation to a DDD project and if so what the pitfalls/gotchas were.
I'm looking at a extremely complex state processes that looks like WF would be a good fit for, but am trying to determine how to isolate the workflows from manipulating the state of my domain model. It was suggested to me to make a decent anti-corruption layer and go from there.
Anyone else had experiences with this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
域事件是一个非常好的解决方案,正如 Udi Dahan 在此所描述的< /a> (这是第三部分;您可能还应该阅读他的前两部分)。基本上,您不需要将域对象注入到工作流基础设施中,而是引发路由到适当聚合根的事件。
A really great solution are domain events, as described by Udi Dahan here (this is part three; you should probably also read his two previous parts). Basically, instead of injecting domain objects into you workflow infrastructure, you raise events that get routed to the appropriate aggregate roots.
“我正在研究一个极其复杂的状态流程,看起来 WF 非常适合”
这实际上不是基于活动的工作流程所擅长的事情。不幸的是,这就是WF的架构模型。在 WF 4.0 中,他们甚至从工具箱中删除了状态机工作流程。
使用 ILog 形式的东西可能会更好。这是一篇不错的博客文章,将其与 BizTalk 进行比较,可以说 BizTalk 比 WF 具有更强大的工作流程/编排功能:
链接
"I'm looking at a extremely complex state processes that looks like WF would be a good fit for"
That's actually not something that activity-based workflows are good at doing. Unfortunately, that is the architectural model of WF. In WF 4.0 they've gone so far as removing the state machine workflow from the toolbox.
You may be better off with something in the form of ILog. Here's a nice blog post comparing it to BizTalk, which arguably has a more powerful workflow/orchestration capability than WF:
Link