Home Books Software Projects Forums

An Interview with Eric Freeman
Co-Author of Head First Design Patterns


Objects by Design is pleased to bring our readers this interview with Eric Freeman, co-author of Head First Design Patterns (O'Reilly - October, 2004). In this interview, Eric discusses the ideas that went into creating the innovative, interactive style of the Head First series, a style which makes learning a challenging subject such as design patterns exciting and fun.

Visual Learning

The Head First series emphasizes highly visual approaches to learning. Both the UML and Design Patterns are also very visual approaches to understanding complex software systems. Do you actively use UML in your work? How? Are there other visual or interactive approaches to software development you have employed?

Yes, we're huge fans of the visual approach, as becomes obvious when you crack open any Head First book. We believe UML has its place as a well-defined methodology, and using UML in the Design Patterns book was particularly vital to clearly representing the roles, responsibilities and relationships of the classes that make up the various patterns. That said, we believe many kinds of visuals should be used to help the reader learn. Take, for example, the way we describe the Adapter pattern - while we certainly provide a UML diagram for the reader, we don't start there, we start with a picture like this:

Which works a little better than starting the reader off with the UML:

The reason the non-UML diagram is particularly effective at communicating the Adapter Pattern is because it leverages the readers real-world experience to quickly get across the "intent" of the pattern. In contrast, there's just a lot of cognitive overhead when looking at the UML diagram and having the pattern's intent jump out at you. But, once you've got the intent and the big picture relationships down, the UML clarifies the pattern and defines the precise relationships between the classes.

It's interesting, if you would ask me if I would rather if a developer working for me could either name the intent of a pattern or draw its UML diagram, I would have to side with the intent and give them a book to look up the UML. For instance, if you just understand the class diagrams of Strategy and State without understanding their intent, then those patterns aren't going to be very useful to you - they have the same diagram! So we often use non-UML visuals to get the big picture across, but always clarify things in the end with "Head First" UML.

In the Head First books you will find we take a lot of artistic liberty with UML interaction diagrams, in fact, it is fair to say we don't use them and instead go with an ad-hoc interaction format that includes pictures, objects, hand drawn arrows and our own written annotations. From our perspective we're writing learning books and our primary goal is to help the reader understand the interaction, not to precisely document it in a technical manner.

Visual Prototyping

There are a lot of interesting visual tools out there and I will talk about a few that go beyond object-oriented design. For instance, there are some really interesting visual tools for designing software for user interfaces.

I'll start with something that is an API/prototyping tool: Ken Arnold's Napkin Look and Feel, which is a pluggable Java look-and-feel tool for Swing. The idea: you're doing an interface prototype and you don't want to give your audience (say, your boss or the "Executives") the impression that the application is practically finished (or you don't want them worrying about what image is in on each button or other look and feel issues). The answer: use a look and feel that looks like it was developed as a drawing on a napkin. Here's an example:

Being a former Disney guy, I'm also big on the idea of "story boarding" and I think it is one of the most underused techniques for designing interactive systems. As an aside, we very much see Head First books as interactive systems that have been flattened into 2D books, and we heavily use story boarding in writing these books. But what about story boarding for, say, web design? There's a great tool out of UC Berkeley called DENIM, that does just that.

Using Denim, you sketch out your interface, again, just as if it were on a napkin (a writing tablet helps - another item all of us Head First authors use on a daily basis), and by using gestures you can link the pages, add links and buttons, and even add conditional behavior. At any time you can enter into a playback mode and navigate through the web design. This is a wonderful way to explore a web design or even to do early prototyping with clients. There's a nice video available on the DENIM site of the tool in action, or better yet, download a copy and give it a try.