views:

145

answers:

2

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?

+1  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.

pmf
A: 

"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:

http://geekswithblogs.net/AndrewSiemer/archive/2009/03/30/ilog-rules-for-.net-3.0-ndash-quick-overview.aspx

Udi Dahan