CAB Smart Clients in an Agile World Part 1
This is the first part, I hope, of a multi-part series on how I come to conquer my fears, learn to love the Composite UI Application Block (CAB) and bring into an Agile project while minimising the associated risks. So what is CAB? So it turns out that many of today’s Smart LOB Clients, ours included, are very complex, with lots of interactions. Unless a good architecture is used, you end up with a complicated BigBallOfMud. The project I have been working on the last 5+ months had accumulated a large TechnicalDebt with a lot of WinForms with embedded logic in the forms. This is evil for obvious reasons. You want to apply Model-View-Controller or Model-View-Presenter to separate your UI logic away from presentation. This also facilitates unit testing of UIs, something people always struggle with. We knew that we had to do a lot of refactoring to MVP.
Also, because of the complex UI, we wanted to use CAB to help “wire stuff up” so that we could focus on our logic. Microsoft states the benefits of CAB as the following:
Building an application with the Composite UI Application Block provides the following benefits:
- It allows you to build clients composed of independent yet cooperating modules.
- It separates the concerns of module builders from the concerns of the shell developer, allowing business units to concentrate on development of domain-specific modules instead of the client architecture.
- It provides an architectural framework for producing a consistent and high quality integrated desktop development.
- It increases productivity and reduces overall development time through consolidating architect and developer efforts.
I knew about CAB for over a year. Yet CAB’s seeming complexity had overwhelmed me. Every time I looked to architect our solution in CAB, I found myself lost in a sea of WorkItems, Modules, Containers, Smart Parts, Presenters and much more!! I spent a few months in this dazed state. Finally, the technical debt was piling high and we had to do something. The problem was it was a big unknown to even do a CAB prototype. So what do you do in an Agile project when you have no freaking clue what you are doing? You declare a “Spike” to figure out answers to tough technical or design problems and timebox it. So, I ended up doing a solo one day CAB Spike to see if I could come up with a prototype that reflected our project. I ended up using some of the CAB WalkThrus that day about a month and 1/2 ago and I ended up really understanding CAB that day by writing all the code. I was successful and ended up able to come back to work and pair with one of our great developers to fold it into our “Dashboard Module.”
Part 2 of this series will be some of this code to develop a simple CAB Shell and Module
Now playing: Ramones - It's Alive - Pinhead (Album Version)
Now playing: Ramones - It's Alive - Do You Wanna Dance? (Album Version)