views:

47

answers:

1

Context: The structure of the code is that a WCF service (server-size) talks to a domain model, which talks to the data layer. I have a need that work assignments (for real people) need to be created when certain values change in an entity.

Currently, I have placed that logic in the WCF service, but it makes me feel kind of icky. I then proceeded to move the logic into a Repository, but that made me feel icky too. Now I don't have anywhere to put it.

What I do not have is a Domain Service to itermediate between the WCF service and the domain repository! Is this something I should create and place this logic there? Do you have any other ideas?

+1  A: 

Your domain model is what should understand that there are special actions that need to be taken when these property values change. The details of the actions should be separated out - possibly into workflows using Windows Workflow Foundation. That allows for easy customization, asynchronous processing, and even human workflows (a person needing to approve something before the workflow is complete).

Of course, if you feel the need, it's easy to create a workflow service using WCF. There are even templates for it, and that's the direction in which the forthcoming Dublin fnctionality is aimed.

John Saunders