workflow-foundationdomain-driven-design

Workflow Foundation with DDD


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?


Solution

  • 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.