The XAML Effect

Back Draft


The XAML Effect

What will happen when Windows and the Web collide?


By Jonathan Goodyear


Web development has long been rooted in tag-based user interfaces. After all, HTML tags form the structure of most of the Internet's Web pages. The transition from the static Internet to the dynamic Internet took tag-based development on a nasty (but, at the time, necessary) segue to tags constructed on the fly via script code in Classic ASP. Unfortunately, Classic ASP didn't provide for any event mechanism and the mixture of user interface and logic code made for quite a mess.


The introduction of ASP.NET restored order to tag-based user interface development by implementing an event mechanism that allowed for the separation of user interface controls and the code that manipulates them. As I stated in my October 2003 column ("Declaratively Speaking"), Web development continues on a trajectory toward a more and more declarative development model with powerful new tags forthcoming in Whidbey.


Windows user interface development has followed a much different track. In Windows, you must explicitly and programmatically create each control on your application's user interface. Even though the design surface of many IDEs (such as Visual Studio .NET) give you a nice GUI to construct user interfaces, the code that is generated still builds each control on the fly when the form loads.


The Extensible Application Markup Language (XAML), which will be released with the Longhorn operating system, radically changes how client-side Windows application user interfaces are constructed. Using XAML, you can design your user interface using tags, very similar to how you do it in ASP.NET. For instance, here is an example of how you might declare a Button control in XAML:


<Canvas ID="root"



  <Button>XAML Rules!</Button>



In case you're wondering why you'd want to declare your user interface with tags, imagine being able to tailor or skin your Windows application without having to recompile it, just by modifying an XAML file. The logic to manipulate your XAML controls would be in a code-behind file, so it would work with whatever user interface design you came up with. Sound familiar? This definitely blurs the line between Web development and Windows development.


So why am I writing about a technique to build Windows user interfaces in an ASP.NET magazine? Because once Longhorn is released, XAML is going to penetrate all facets of software development. You can bet that XAML will be closely intertwined with Internet Explorer, making it an attractive platform for a new breed of smart client-side Web applications, and that is where Web developers can score big.


Of course, no article of mine would be complete without me complaining about something, so I'd like to point out that not all of XAML's features completely agree with me. The biggest issue with XAML I see so far (remember that it is still evolving quite rapidly) is that you are currently able to embed .NET logic code into the user interface definition file using CDATA sections. Personally, I think that it would be a big mistake for Microsoft to keep this feature in when Longhorn ships, because it promotes the blurring of logical application tiers and fosters bad application design. Because ASP.NET allows a similar mixture of user interface tags and .NET logic code in the same file, though, I'm pretty sure that Microsoft is aiming for ultimate flexibility over enforcing design elegance. We'll have to resort to proper design education to prevent XAML abuse.


Preparing your applications today for XAML is pretty straightforward. Do everything in your power to keep business logic separate from your user interface logic. That's good advice, regardless of the development architecture you are targeting. That way, it'll be easier to port your ASP.NET tags to XAML tags (which are directly related to .NET Framework classes), should you wish to add a richer user interface experience to your applications.


So, should you all go out today and learn XAML? I wouldn't jump the gun too quickly. After all, Longhorn isn't expected to ship for almost two years. You should definitely track it on your radar, though, because XAML represents a significant opportunity for Web developers to bridge the gap to Windows development (and all of its advantages) without having to significantly change their mindset. Like ASP.NET, XAML is so big that you just can't afford to ignore it. Luckily, I think that a good majority of XAML-based applications will be a hybrid of Windows and Web development. Don't be surprised if you see XAMLPRO magazine at a newsstand near you.


Jonathan Goodyear is president of ASPSoft (, an Internet consulting firm based in Orlando, Fla. He's a Microsoft Certified Solution Developer (MCSD) and author of Debugging ASP.NET (New Riders). Jonathan also is a contributing editor for asp.netPRO. E-mail him at mailto:[email protected] or through his angryCoder eZine at




Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.