Presents your XML AND WEB SERVICES E-NEWSLETTER for November 3, 2003 <-------------------------------------------> WHY XML IS IMPORTANT TO WEB SERVICES Web services is often described in terms of its component technologies. The use of SOAP, UDDI, WSDL, XML, and HTTP all comprise the pieces of the Web services architecture and each one contributes important functionality. Here are some of the things that XML technology brings to the Web services platform. STANDARDIZATION As with all of the Web services technology, standardization is key to making XML successful. Using XML provides a standard format for data being transmitted to and from Web services applications. The W3C manages the XML standard and publishes it for global adoption by XML technology providers, ensuring the compatibility of XML products. Beyond the XML engines and products are the XML grammars. Each XML grammar represents a standard approach for formatting data within a particular problem space. By agreeing on and using XML grammars, you can standardize the data format used to communicate between applications. INTERFACE CONTRACT When programming with interfaces, programmers often refer to them as contracts. Programmatically, an interface provides the structure for programming without exposing the implementation. XML has a similar feature when you use DTDs and schemas. Both DTDs and schemas describe the structure and rules for creating XML documents. A set of these rules organized into one or more related DTDs or schemas is called an XML grammar. Employing an XML grammar not only helps standardize the communication between applications, but it also provides developers with an interface contract. In other words, the developers don't need to know the implementation (i.e., an actual XML document) to create an application that understands the document's structure. The DTD or schema describes the structure and can be used as the interface contract for development. Any change to the DTD alters the contract. SIMPLIFICATION Another key aspect of XML is its simple nature. I'm not implying that all XML implementations are a cakewalk; rather, that the concept of XML and the general approach is simple. For example, XML is based on text documents. This simplifies the process of opening up an XML document and viewing the contents. It's also important that XML be simple to help simplify the Web services model. Web services is inherently more complex than XML alone. Now, if XML were as complex as CORBA, and if all of the other Web services technologies were equally complex, then Web services technology would be too cumbersome. But by using simple building blocks, such as XML, SOAP, and so on, Web services achieves a tolerable level of complexity without creating unmanageable applications. ENCAPSULATION One of my favorite features for using XML, particularly for Web services development, is encapsulation. Encapsulation is essentially the concept of taking one or more chunks of data and grouping them together as a single object rather than as several independent objects. While this is similar to aggregation, the important difference is that encapsulation generally implies that there are no external dependencies. You can create XML documents with external dependencies; however, in a transactional Web services model, it makes more sense to take advantage of encapsulation. By designing XML solutions that package dependencies, you can often eliminate problems in transactions. Forcing a transaction to locate external data and reconcile it with XML data can be detrimental, particularly if the external data is apt to change. Encapsulating the data into the XML grammar makes it available for the transaction with the correct data. Brian Schaffner is an associate director for Fujitsu Consulting. He provides architecture, design, and development support for Fujitsu's Technology Consulting practice. ----------------------------------------