Using XML For Client Side Computing
Extensible Markup Language (XML) is a simple, very flexible text format initially designed for large-scale electronic publishing. It is flexible, open, human-readable, and can be learned easily. XML can also be generated, parsed, analyzed, and transformed easily. It is no wonder that XML has been widely used for server-side computing: J2EE, .NET and Web Services.
However, we have not seen significant use of XML on the client side so far. When we write client side code, we would likely be using HTML/DHTML for browser-based applications, Win32 for Windows desktop applications, and Java Swing/J2ME for Java applications. None of these has anything to do with XML.
The truth of the matter is that XML makes a lot of sense for client side computing. The difference between client side computing and server side computing is that the former is more concerned with user presentation and interaction while the latter is more concerned with business logic and data access. XML has proven to be an effective tool at both the business logic layer and data layer. It also is a great solution to the challenges at the user interface (UI) layer. Two UI layer challenges stand to benefit most obviously from the use of XML.
The first challenge is how to decouple user interface description and UI logic. Separating UI description and interaction logic would allow greater flexibility, clearer separation of programmers and designers, and lower development and maintenance costs.
Today, UI description and UI logic are tightly coupled in most client side programming models. UI description must be written as program code and normally mixed together with UI interaction logic. For example, to create UI layout for a Win32 dialog, a developer must write Win32 code. Changes to the UI layout would require changing the code, recompiling the program and re-deploying the program. The cost and complexity of this process is high.
XML is an ideal candidate to solve this challenge. UI description can be written as XML documents and UI logic can be written in any programming language. Such separation decouples them and creates tremendous flexibility. XML documents can be created and manipulated by many tools and are human readable. Additionally, designers with HTML skills will have no problem dealing with XML documents. UI designers can create and edit such documents without touching the UI logic. UI developers are free to code UI logic without getting bogged down in UI design. Such clear separation would significantly lower development and maintenance costs.
Additionally, using XML for UI description would enable better development tools. The best development tools today, like VisualStudio.NET, enable visual design of user interfaces in a drag and drop fashion. However, these tools are merely “UI code generators” for developers and preclude the participation of people other than developers. For example, VisualStudio.NET would generate UI description as C# code and only C# developers have the skill sets to use such code. Furthermore, when developers modify such C# UI code, it is a daunting task for the development tool to parse the C# code, figure out what has been changed and figure out how the change should be reflected in the visual design. With XML for UI description, it would be easier to create tools that enable two-way editing of UI design for non-programmers and enable programmers to concentrate on business logic.
The second challenge is how to decouple the user interface layer from the underlying platform or device. Companies will always have different computing platforms, including hardware systems, operating systems, and browsers. If applications can run on any browser, operating system, and hardware device, the cost for development, deployment, maintenance, and support would be dramatically lower.
It is easy to see how business logic can be made platform independent, but it is much harder for UI. Even Java, the language invented for “platform independence”, did not solve this challenge well. As a result, most client side programming models are tied to the client side platform, such as Win32, MFC, Java Swing, and DHTML.
XML is inherently cross-platform. UI designers can use XML to describe their design and the cross-platform nature of XML would enable such information to be communicated accurately to different platforms. Different platforms can choose to present such UI in a platform-optimized way without requiring UI to be hard coded into this platform. UI logic can be easily compiled or coded to run cross-platform using available technologies today, such as Java or JavaScript. Even if there are incompatibility issues, they can be solved by leveraging the flexibility of XML, for example, XSLT.
Though not in mainstream use yet, client-side XML is starting to get more attention. There have been efforts and successes from standards bodies, and startups are beginning to deliver real commercial implementations. SVG, Scalable Vector Graphics, an XML standard for 2D graphics over the Web, is a W3C standard and has gained a lot of support in the industry. XUL, an XML language for describing rich user interfaces, developed by Mozilla, significantly increased awareness of client side XML. On the commercial implementation side, there have been quite a few successful examples. For example, Starwood Hotels developed a customer response system across its hotel chains (http://www.nwfusion.com/ee/2003/eecrm.html). The user interface of the application is written using XML and the UI logic is written as client-side beans. It runs inside any 4.0+ browser on major platforms, deploys like a normal web application with zero client install, but delivers native desktop application performance and functionality. It is hard to believe that it is a web application. The application was rolled out to 200+ hotels across the country in September 2002 and has been running non-stop for 14 months, supporting thousands of users distributed across the country. The results were significant: shorter development cycle, huge deployment and maintenance savings, and higher user satisfaction and productivity. It was awarded 2002 InfoWorld top 100 innovations (http://www.nwfusion.com/ee/2003/eecrm.html).
What started as a great success on the server side is just now beginning to show its strengths in client-side programming. We have yet to see the full potential of client-side XML, but can expect to see much more as it drives a client-side revolution.
-
Anonymous
-
Anonymous
