Wiring up WorkItemControllers

Topics: CAB & Smart Client Software Factory
May 3, 2007 at 6:11 AM
Suppose I have a Customer module and a deals module. One of my use-cases is to assign deals to customers.
This contains a sub use-case which is to find a customer.

My original implementation raised an event to say the AssignDealWorkItem has been created. This was subscribed to by the Customer module which added a sub WorkItem of finding a customer.

Given that I know the use-case up front though, am I correct in thinking the AssignDealWorkItem should create the FindCustomerWorkItem as a sub-workitem itself, instead of hoping it gets wired up via. an event. The FindCustomerWorkItem would then sit in an independant module which could be used by many modules including Deal and Customer.

Am I right in thinking the Use-Case should know what it needs to do its job and more importantly how to find it. It should do this, co-ordinate the different smart parts / sub use-cases via events and commands, and raise events itself to let other work items know of what is happening.

My initial thought about CAB was that nothing should know about anything else, and event pub/sub magic would allow things to be wire up properly. I'm beginning to think this is a mis-understanding and that use-cases, implemented through WorkItemControllers should know about everything they need to complete.

Any input would be great!

Thanks,
Graeme