Composite Application Block or WPF Composite Client?

I’ve had a question from a Greg Bayer this week about what my thoughts were on the Composite Application Block and Smart Client Software Factory (CAB/SCSF) ‘now that it appears that both are being put out to pasture by Microsoft’. My response became a little long to be posted as a comment.

I suspect Greg was referring to the announcements from Microsoft about the ‘Windows Presentation Foundation(WPF) Composite Client’ and the death of Acropolis this week:

Acropolis, of course, was Microsoft’s ‘CAB/SCSF for WPF’ (we’re in acronym hell here). Put more simply, it was intended to be the next version of the Composite Application Block. The Acropolis team have released a few previews (CTPs), but now it appears that a new direction is being taken and something called the ‘WPF Composite Client’ will effectively replace it.

My thoughts on this are that it actually clarifies the situation for those of trying to write user interface software right now. No CAB replacement is arriving soon (a year away), so if we want a composite application framework from Microsoft the CAB has to be the one to go for. And there isn’t anything else on the market that is directly comparable, although obviously there are other dependency injection frameworks we could use.

Even when this CAB replacement arrives it is going to focus on Windows Presentation Foundation (WPF). WPF is the future for user interface developers, and we should all be looking at it. However, I wouldn’t use it for enterprise development right now. It’s still early days for a new technology, it has some serious failings currently (the user interface editor isn’t great), and it has a huge learning curve. It’s not at all clear that taking the risk of using such a new technology is going to give you sufficient business benefit to warrant the extra cost. Some of the major benefits of WPF just aren’t relevant for the sort of application I develop (e.g. better multimedia integration).

And what’s more, you can’t run it on Windows 2000, which can still be an issue if you work in a major organization.

As Glenn Block says ‘Win Forms is not dead.’ ‘Win Forms is the recommended breadth solution for LOB application development for the foreseeable future’.

So, in answer to Greg’s question, the CAB is still relevant, and I would still use it on an application I was starting to build today. That answer may well change in a year’s time however.

Having said all that, my opinions on how we should use the current version of the CAB may not be what you expect. The CAB is a superb piece of software. Even where the Patterns and Practices group have got things wrong they’ve done so in an interesting way, and you can learn from their mistakes.

However using an all-pervasive dependency injection framework can get you into a scoping mess. By ‘all-pervasive’ I mean putting every object you create into a dependency injection container, and only mapping dependencies through those containers (never using ‘new’). Controlling scope doing this is difficult, and you can end up destroying all the encapsulation advantages of object-orientation. I’ll be blogging about this in the future, but I think a more restricted use of the CAB may be appropriate.

3 thoughts on “Composite Application Block or WPF Composite Client?

  1. Rich,
    Thank you so much. You’ve provided some great clarity for us.

    I’ve also spoken to Jeremy Miller who, as you probably know, isn’t too high on the CAB.

    Jeremy is much more in favor of the “build your own” approach.

    What do you think? With the right architect and senior developers, would you bypass the CAB too?

  2. My approach would have to be take the CAB cake without eating all of it. CAB is huge, and when you break it apart, it’s a set of guidance tools. If you went berserk and used everything strictly you might end up with a bad situation. Could you imagine trying to track m2m events when you used them for everything?

    I’ve been struggling with trying to get a “roll my own” block for WPF, now you’ve finally made me click and will now go back to using the more comfortable CAB. If I need richer UI, then I’ll use crossbow by making my smartparts simple winforms controls wit crossbow encapsulating the WPF controls.

  3. Hi Greg,
    I don’t think that architect and senior developers, would bypass the CAB,CAB still very useful and the basics of developement,throught my research some companies are really seraching for people knowinh this new Hi-tech!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s