August 31, 2007
Not all hopscotch and conkers
In what will come as a great shock to those who think the British were above propagandising to children during World War 2, the Beeb digs out such games as "Decorate Goering," "Hang Your Washing on the Siegfried Line" and the ever popular "Throw Darts at Hitler's Face."
August 30, 2007
Should I use WPF for business applications?
The conventional wisdom -- and Microsoft guidance -- on "should I use Windows Forms or Windows Presentation Foundation for my business application" is to use Windows Forms. The justification is that WPF's novel features aren't sufficiently useful to line-of-business applications to balance out Windows Forms' better tools, control set and third-party support. WPF, it is implied, is only worth the candle if you're doing something amazingly fancy in the way of visual design: a "cool" app rather than a useful one.
I think this is nonsense.
It's certainly true that Windows Forms has the advantages people cite. But WPF has a number of features which should make it a serious option for anybody developing a new application, no matter how rudimentary the user interface. Skipping over nice tactical time-savers like layout managers and major but specialised features like navigation and styling, the big two of these are data binding and the rich content model, and particularly the way they work together.
A typical forms application is very data-centric. While Windows Forms 2.0 delivers substantial improvements to data binding over Visual Basic and WinForms 1.x, it's still relatively limited compared to WPF. Bidirectional value converters, multibindings, validations and the ability to bind non-primitive types are just a few of the features that make it easier to build data-centric forms in WPF than in Windows Forms, even if those forms are visually quite simple.
But in WPF there's no need for forms to be bald and textual. The rich content model makes it almost as easy to create simple visualisations as to display raw text. Sure, if you want elegant or complex visuals, you have some work to do, but in WPF you pay only for what you use: you don't incur the responsibility of having to draw everything from scratch just because you want one of the words on a button to be bold or list box items to be colour coded, or of having to implement all sorts of list control behaviour just because you want to display a collection in a format other than a stack.
This gets really powerful when you start harnessing data binding and the rich content model together. In Windows Forms, if you want to implement a complex visual interface such as a Gantt chart or a geographical display, you have to write a lot of code to draw the control, handle input such as keyboard and mouse input and manage the view data model (e.g. selection tracking). A WPF Gantt chart is just a list box with the items rendered as rectangles whose width is bound to duration and whose position is bound to their start time. Very easy to write, and things like selection management, arrow-key support and mouse selection come for free. (You have to do a bit more work to allow users to drag the rectangles, but once you've done that, hooking those UI events back to the underlying model is just a matter of making your data bindings two way.)
For me, the killer application of WPF is not bouncing buttons with dancing elves trapped inside them. The killer application is information visualisation, the kind of things you get from Tufte and the periodic table. And that's something that even forms-style, line-of-business applications will find worthwhile.
TechEd BizTalk WCF adapter talk
For those who just can't get enough of the BizTalk 2006 R2 WCF adapter, the slides from my TechEd talk are here.
The danger of years in product names
One of the sales guys was writing a RFP response and needed to say which version of Windows our platform ran on. "Windows Server 2003," I told him.
He looked nervous.
"Isn't that going to sound awfully out of date?" he asked. "I mean, that's four years ago."
August 21, 2007
Nazi board games
BBC News: "You can be confident kids in Germany in the early 1940s were playing these games... They say a lot about the Nazis, and about the German regime. Our kids were still playing trains and Meccano and hopscotch and things like that. These show how the Nazis were determined that children as young as four or five needed to get into the swing of things."
Well, yes, but look at Victorian children's games and stories too. Let's not overidealise here.
August 10, 2007
Design patterns books
There was some discussion of design patterns at the last Wellington geek lunch and a number of books were mentioned. Ivan was going to post a list but until his comes along, here are the ones I remember talking about:
- Gamma et al., Design Patterns. Somebody was asking what was meant by "the Gang of Four." This is it.
- Buschmann et al., Pattern-Oriented Software Architecture. Larger-scale patterns: where Gamma et al. focus on the design of components, Buschmann et al. focus on ways of putting those components together.
- Martin Fowler, Patterns of Enterprise Application Architecture. Tending to deal with how to implement a conceptual model; for example, the specifics of how to transmit data between the domain model and the database.
- Joshua Kerievsky, Refactoring to Patterns. Bevan mentioned that he liked to use patterns as "targets" to help him refactor poorly structured code. Kerievsky describes how to identify and approach appropriate "targets."
Others that didn't come up but are also well worth a look are Fowler's Analysis Patterns, Hohpe et al.'s Enterprise Integration Patterns and Tidwell's Designing Interfaces.
August 09, 2007
Mostly about tubes
Back on the Internets tubes after about two weeks of being cut off. On the plus side, well done Ihug for managing to get me set up despite being a million miles from the exchange; on the minus side, boo hiss Ihug for taking three weeks to do it. The computer has barely been on during this period; I hadn't realised how Internet-focused my home use of the machine had become.
My own personal tubes remain blocked by the Great Plague of Old Wellington Town, and I am currently unable to speak for more than about 3 minutes without dissolving into a coughing wreck. I have 68 hours to recover or I will find myself having to explain Windows Presentation Foundation data binding through the medium of interpretive dance.
Hmm... still... if Don Box can do it...