Minimal IT logo and link to home page
Research, training, consultancy and software to reduce IT costs
Home | About | Newsletter | Contact
Previous | Next Printer friendly
25 October 2005

Minimal integration 4: XML is beautiful

By Andrew Clifford

XML is a way of structuring data that works very well with integration. XML is simpler than many people imagine.

Extensible markup language (XML) is often used to build interfaces. This week I will answer the questions: what is XML, why is it so useful for integration, what are the benefits, and what are the drawbacks? Next week I will describe how to keep XML very simple.

XML is a markup language. It is a way of adding extra bits of information to your data so that you can understand what the data means. So, instead of passing 018716, which is meaningless, you can pass <productNumber>018716</productNumber>, which makes it easier to understand what the data means.

As well as marking up the data, XML allows you to group data together into structures. So you could code an item on an order like this:

<OrderItem>
  <productNumber>018716</productNumber>
  <quantity>2</quantity>
</OrderItem>

The XML is shown spaced out on separate lines to make it easy to read. It would mean the same if it was all one long string.

You can build up more complicated structures, with nesting and with repeating groups:

<Order>
  <customerName>Mr J Smith</customerName>
  <OrderItemList>
    <OrderItem>
      <productNumber>018716</productNumber>
      <quantity>2</quantity>
    </OrderItem>
    <OrderItem>
      <productNumber>907232</productNumber>
      <quantity>1</quantity>
    </OrderItem>
  </OrderItemList>
</Order>

To remove dependencies between systems, interfaces should pass all the information that is required to complete the job in a single instance of the interface. This can be termed a logical unit of integration (LUI). XML supports this beautifully. It allows a LUI to be coded as a single message that can be sent from one system to another.

XML solves some of the technical problems of sending data between different computers. XML provides comprehensive facilities for sending special characters in the message, and dealing with different character sets. Unlike some standards, there are no problems with sending data with € symbols, quote characters, or line breaks using XML.

XML is very well supported by integration tools.

So, to recap, the benefits of XML are:

  • It makes interfaces easier to understand.
  • It help keep systems independent because it allows all the information required for a LUI to be coded as a single message.
  • It allows for special characters and different character sets.
  • It is well supported by tools.

The drawbacks of XML are:

  • XML produces larger messages which can take longer to transmit.
  • More advanced uses of XML are difficult to understand.
  • XML can be difficult and slow to process.

Usually larger messages are a reasonable trade-off for the advantages of XML. Where network bandwidth is sufficient, or messages are small, it is not a problem. XML compresses well because it is all character data, so where data volumes are a problem data compression can be used.

Next week I will explain how to keep XML very simple, so that it is always easy to understand. Later I will describe how to program with XML so that it is easy and very fast.

Next: Minimal integration 5: keep XML simple

Subscription

Subscribe to RSS feed

Latest newsletter:
Magical metadata

We use the term "metadata-driven" to describe IT solutions in which functionality is defined in data. Taking this to the extreme can provide unparalleled levels of speed, simplicity and versatility.
Read full newsletter

System governance

System governance helps you implement high-quality systems, manage existing systems proactively, and improve failing systems.

Find out more