Many years ago, O’Reilly’s UNIX in a Nutshell by Arnold Robbins helped me get up and running with the cryptic operating system, and I’ve been a big fan of the In a Nutshell series ever since. So I was anxious to tackle XAML in a Nutshell by Lori A. MacVittie with the hopes of gaining a better understanding of the new technology. Find out why I give this programming book a mixed review.
What is XAML?
Before delving into the specifics about this title, I feel that it’s important to offer an overview of the Extensible Application Markup Language (XAML).
XAML (pronounced “Zammel”) is the XML-based markup language that works with the new graphic subsystem delivered with Microsoft Vista and .NET Framework 3.0 (previously called WinFX). This graphic subsystem is called the Windows Presentation Foundation (WPF).
The goal of XAML is to simplify the creation of user interfaces via .NET Framework 3.0. You can create visible UI elements in the declarative XAML markup, and then separate the UI definition from the run-time logic by using code-behind files that are joined to the markup through partial class definitions. The Windows Forms programming model is still available in .NET 3.0 — XAML just provides an alternate approach.
Now I’ll fill you in on what you can expect from O’Reilly’s XAML in a Nutshell.
The layout
XAML in a Nutshell provides a brief introduction to XAML, as well as a language reference. The book consists of two basic sections: language introduction and overview (which contains a reference section).
Chapters 1, 2: Introduce XAML and provide information to get using the language as soon as possible. This includes technical prerequisites and the basics of building applications with MSBuild and developing XAML with Visual Studio.
Chapter 3: Provides coverage of the core XAML language, as well as an overview of XAML elements, attributes, and properties. This chapter closes with a brief description of the code-behind model used with XAML.
Chapter 4: Covers the layout and positioning of XAML elements.
Chapter 5: Focuses on the resources that facilitate the usage of common styles or elements throughout a UI.
Chapter 6: Covers animations and storyboards. (The animation features of XAML promise to bring Flash-style interfaces to Windows developers.)
The hits and the misses
While the first six chapters provide a good foundation on XAML, they only comprise roughly 90 pages or about 30 percent of the book — the rest of the text is devoted to reference material that is readily available online. Also, the technology has changed since the book was released in 2006, so some of the information is out of date.
The focus of the book is XAML and defining UIs, but it would have been nice to have information on hooking the UI to an application or business logic. This would have required extensive .NET code, so this may not be a valid request given the focus of the book. The book does include extensive XAML markup, so it does maintain that focus.
I am impressed with the XAML approach to coding a UI because it opens up the process to nondevelopers, such as graphic designers. The book also promotes the separation of code from layout — it sort of follows the tiered approach to building Web pages. On the other hand, I don’t know of any clients using Windows Vista or .NET Framework 3.0. The existing Windows Form technology is well-known and tested, so steering developers away from it will be a hurdle.
Whet your (XAML) appetite
XAML in a Nutshell provides a quick and painless introduction to XAML, along with a paper reference of the language. It started well, but it stopped when the material was getting interesting. A deeper coverage of the technology would better serve the reader as opposed to the large reference section.
The book is better suited as a pocket reference than a learning material. The language reference included is out of date since the book was published before the release of Windows Vista. These days, such references are easily available online, so the book pages could have been better used to deliver more material on actual language usage and examples. The XAMLDEV site is a good example of the numerous online resources where you can learn about the technology.
Download a sample chapter
If you’d like to read a section from this book before investing in a copy, download Chapter 3 from XAML in a Nutshell. It focuses on the core XAML syntax, as well as some of the peculiarities of the syntax.
Tony Patton began his professional career as an application developer earning Java, VB, Lotus, and XML certifications to bolster his knowledge.
—————————————————————————————
Get weekly development tips in your inbox
Keep your developer skills sharp by signing up for TechRepublic’s free Web Development Zone newsletter, delivered each Tuesday. Automatically subscribe today!