Probably the largest single piece that you need to understand about CAB is the WorkItem.
As I mentioned before, WorkItems are usually 1:1 with use cases. For example, say we are buiding a CRM product, we might have a use case called “Edit Customer.” This would map to an EditCustomerWorkItem.
Think of the WorkItem as a container for anything related to the use case. It can house various elements such as UI components, state, services, etc. This gives you a nice boundary for when things get instantiated or destructed.
WorkItems live inside of modules, and are instantiated by the ModuleInit class.
So say, given the example above, we have loaded our CustomerInformationModule, which contains an EditCustomerWorkItem. The workitem might contain:
If you don’t do your use case homework, your work items will “go against the grain” of the application and add unnecessary complexity to the whole framework. Do your use case work up front, and you’ll be designing better WorkItems.
I'm Ben Scheirman. I am a .NET software developer with a strong interest in agility. I work as a Principal Consultant with Sogeti.
Read more here.
email me
Ads by The Lounge
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.