Welcome!

.NET Authors: Hovhannes Avoyan, Bruce Armstrong, Pat Romanski, Liz McMillan, Yeshim Deniz

Related Topics: .NET

.NET: Article

The Xamlon Story

.NET code + XAML markup = Flash SWF

Xamlon, a small startup in LaJolla, CA, started with a Windows desktop product called Xamlon Pro. This package provides developers with a taste for XAML-based declarative markup programming. XAML is compiled with managed code to produce applications that run in the Xamlon viewer. This is the same approach that was promised in the Longhorn timeframe with the new Avalon user interface engine.

Their newest offering does something similar for Web development, with an interesting twist. The output is a true Macromedia Flash SWF file. This is significant given the market coverage of the Flash player, a small download that is readily available. Applications developed with Xamlon Web run on most any platform or browser combination without installing the .NET framework.

Xamlon is the latest brainchild of Paul Colton, CEO and founder. Paul is best known for the development of JRun, the Java server environment marketed by Macromedia. His long partnership with that company made him intimately aware of the potential for Flash applications.

Flash runs inside a "Virtual Machine" similar to the runtime environments of .NET and Java. A set of instructions called bytecode is loaded into the runtime and translated into machine instructions on the target computer. Flash uses the SWF file format that was made public in 1998. More than 98 percent of all computers are thought to have the Flash player installed. Flash development is historically difficult and there is a shortage of competent developers. The Flash IDE is really designed for graphics and animation, not for business application programming. ActionScript, a JavaScript derivative, has a limited syntax and little support for debugging.

There are other platforms for Flash application development, including Macromedia Flex and Laszlo Systems, but Xamlon replaces the need for ActionScript with the strong foundation of Visual Studio support and a strongly typed .NET managed code library. Once compiled into MSIL, the .NET byte codes can be mapped to the well-known Flash equivalents. This opens the Flash file delivery format to the millions of C# and Visual Basic coders.

Xamlon Web takes several interesting technologies and merges them into a developer friendly platform:

  • XAML declarative markup
  • .NET byte code compilation
  • Flash SWF deployment
  • AFLAX Web services
XAML Declarative Markup
Declarative programming is different from traditional imperative programming. The developer describes a set of conditions but not the order they are executed. The syntax interpreter or compiler is free to analyze the statements and build a suitable algorithm.

Most declarative programming today is done with some variant of XML. Configuration files in Visual Studio and the .NET Framework commonly use XML. Web.config and app.config are good examples of the declarative model:


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<compilation defaultLanguage="vb" debug="true" />
<customErrors mode="RemoteOnly" />
</system.web>
</configuration>
There are several areas where Microsoft is using declarative style. The server-side controls in ASP.NET are described using a namespace, tags, and attributes. This sample mixes HTML mark-up with CSS and server control declarations:

<TR style="HEIGHT:90%">
<TD style="PADDING:10px; WIDTH:150px; BACKGROUND-
COLOR:wheat" vAlign="top">
<uc1:Menu id="Menu1" runat="server"></uc1:Menu>
</TD>
<TD vAlign="top" style="PADDING: 10px;">
<P>WorkArea</P>
<P><asp:Label id="Label1" runat="server">Label</asp:Label></P>
</TD>
</TR>
InfoPath forms are described in an XML dialect. SQL Reporting Services reports store their layout in an XML format called RDL (report definition language). Server applications like Microsoft CRM use XML to describe data, forms, views, reports, and transactions. BizTalk Orchestra-tion defines business process flow in an XML structure. Both SQL Reporting Services and BizTalk compile their XML into .NET assemblies. This is similar to the approach taken by Xamlon.

Longhorn has a new visual programming model called Avalon. At the heart of this is a new interface dialect called XAML, or eXtensible Application Markup Language. XAML is very powerful in that each element and attribute maps to some object in code. A XAML element name becomes a .NET Framework class name. When you define an XAML element, you are effectively creating an instance of the .NET Framework class with the same name as the XAML element. An XAML attribute name maps to the property or field with the same name, typically in the class instance:


<Canvas>
<TextBox ID="FirstName" />
<Button ID="Submit" Click="SubmitForm" />
</Canvas>
This is equivalent to writing the code:

Dim c As New Canvas
Dim fName As New TextBox
fName.ID = "TextBox"
c.AddChild(fName)
Dim b As New Button
b.ID = "Submit"
AddHandler b.Click, SubmitForm

More Stories By Bill Wolff

Bill Wolff is an independent consultant, trainer, and architect specializing in Microsoft development technologies. His company, Agility Systems, is based in the Philadelphia area. He ran the consulting firm Wolff Data Systems for 15 years and directed armies of consultants in the dot com world. Bill is founder and President of the philly.net user group, board member for INETA (Vice President, Speaker Bureau), and he is active in several other user communities. Bill was a contributing author to several books and articles and he currently writes for .NET Developer's Journal. His certifications include trainer, systems engineer, developer, and Microsoft MVP for VB.NET.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.