The Role of XML in Agile Enterprise Architecture, Page 2
XML Usage in Each Tier
Now, we've covered a brief introduction to XML, its virtues, and resultant innovation. We've also covered a typical tier structure for describing enterprise architecture. Let's see how XML and XML technologies map to the enterprise tiers.
One of the initial uses of XML was to communicate messages between tiers. It didn't matter that tiers may reside on different hardware and software platforms. XML is portable between heterogeneous platforms because it is a standard, self-describing, text-based format. Once XML became prevalent in inter-tier communication, it began to be used intra-tier as well.
XHTML is HTML that is also a well-formed XML document. It basically turns HTML into an XML vocabulary. Why is this significant? HTML was a bit too lax and forgiving, causing ambiguous markup code and browser compatibility issues. By being well-formed, XHTML improves upon HTML's slackness. It can be parsed with standard XML parsers, queried by XPath, and even transformed via XSLT.
XSLT, a transformation language for rendering XML into other markup formats, makes it possible to render HTML directly on the client from an XML data source. This provides a clean separation from the data, represented in the XML document, and the presentation, represented in the generated HTML. CSS (Cascading Style Sheets) are another technology that can be used on the client to present XML documents in a browser and eliminate HTML altogether.
XForms is a maturing technology that has the potential to revolutionize user interface development. It also separates data from presentation and adds features lacking in HTML forms, such as strong typing, validation, reduced server trips, reduced need for scripting, and an XML representation of form instance data. It provides an XML-friendly manner of data capture.
Because of browser compatibility issues with non-standard XSLT implementations, XSLT has also become prevalent in the presentation tier. Often, the view in a MVC framework is implemented in XSLT. In this approach, the stylesheet may be called from the controller to render an XHTML response to the client from an XML source document.
It is also becoming more common for the model in MVC to be implemented in XML. With this approach, XML documents might be held in session, accessed via DOM or XPath API, and wrapped by objects to add behavior and encapsulate the XML.
Service-oriented architecture is not a new concept. However, it has gotten a shot in the arm from XML. Web Services—a recent implementation of SOA—owes a debt of gratitude to XML for enabling this technology to flourish and prosper. HTTP and XML have become the standard protocol and payload for sending and receiving messages with the service tier.
A typical service tier utilizes many XML vocabularies. WSDL (Web Services Definition Language) is a vocabulary for describing a service and its contract. SOAP (Simple Object Access Protocol) is a vocabulary for passing objects between components in a decentralized distributed environment. There are a plethora of industry standard vocabularies, such as ACORD XML in the insurance industry, used to describe the messages passed in a SOA.
To receive and send messages, the service tier uses XML parsing API such as DOM, SAX, and StAX. A service provides an interface to applications, components, and resources which themselves may have an XML-based API. Often, the service will use XSLT to transform requests and responses to and from these components as per the service contract.
Because the service payload is in XML, a service management tool usually has the capability to "mine" the request and response messages via XPath for relevant auditing, metering, billing, and traceability information.
Once XML became prevalent in other tiers, it naturally led to XML being persisted in the resource tier. All relational databases support XML storage in some way. XML databases have emerged as a specialized category of databases for storing XML documents. These databases excel at storing unstructured data, transient data, and configuration data. Because XML Schemas can often be changed without impacting clients, XML provides a very versatile and agile data structure.
XML is becoming the de facto standard for storing configuration data. It has several advantages over other approaches. A single document can store complex data structures of related meta data elements in a cohesive manner. This document can be versioned in a configuration management tool. Document-oriented meta data can be made available to an application via an XML database, filesystem, or URI. It can be loaded in memory as a DOM and easily queried.
XML was born in 1997. Its elegant simplicity, cross-platform compatibility, and many other virtues have led to wide adoption. XML has inspired many technologies. In enterprise architecture, XML has become the standard for inter-tier communication. Within each tier, XML and XML-related technologies have become pervasive.
Why has XML made such an impact in such a short time? Software architectures utilizing XML and XML technologies are more maintainable, portable, reusable, integrable, and testable. XML has tremendously improved agility in enterprise architecture.
Is XML really boring? How people have used it is rather inspiring. How are you going to use XML and XML technologies to improve your agility today? The rest is up to you!
About the Author
|Jeff Ryan is an architect for Hartford Financial Services. He has twenty years experience designing, developing and delivering automated solutions to business problems. His current focus is on Java, XML and Service Oriented Architecture. He may be reached at firstname.lastname@example.org.|