|
|
XML vs. Corba
Over the last two years XML has matured into a widely accepted
standard for exchanging data between organizations as well as
internal applications within the company. XML's ease of use
and wide availability has made XML parsers such as MSXML an
easy choice for simple tasks like formatting configuration files
and complex multi-tiered application architectures residing
on different platforms.
The availability of such tools as XSL
and the Server XMLHTTP component only increase the popularity
of XML, because they bring simplicity to very common development
tasks.
Today, XML is often the language (or format, in this
case) of choice for most companies when it comes to exchanging
data between applications. This includes batch processes, server
to client feeds, custom application-level protocols and a host
of other cases.
A great example of such a process is a data
feed of all orders taken electronically via a web site into
an internal billing and shipping system. The main advantage
of XML here is it's flexibility - developers create their own
tags and dictionaries, as they deem necessary. Therefore no
matter what type of data is being transferred, the right XML
representation of it will accurately describe the data.
Logically,
each order can be described as one customer purchasing one or
more items using their credit card and potentially entering
different billing and shipping addresses. The contents of the
file are very easy to read, even for a person who is not familiar
with XML. The information within each of the order tags is well
structured and organized. This enables developers to use parsing
components and easily access any data within the document. Each
item in the order is logically a unique entity, and is also
represented with a separate tag. All item properties are defined
as "child" nodes of the item tag.
XML is the language of choice
for two major reasons. First of all, an XML formatted document
can be easily processed under any OS, and in any language, as
long as XML parsing components are available. On the other hand,
XML files are still raw data, which enables merchants to format
the data any way they want to. All in all, document structure
and wide acceptance of this format has made it possible to enable
customers to build more efficient internal order Tracking systems
based on XML-formatted order files. Other online merchant sites
are making similar functionality available on their Web sites
as well.
As we see with most commercially available systems
today, XML has become the format of choice for application configuration
files. Take, for example, products like BEA WebLogic or the
Microsoft .NET framework - and you will find that both system-level
and application-specific configuration data is stored in an
XML format.
Along the same lines, we now see XML used for formatting
configuration files in custom-built internal Web and client/server
applications, often even replacing such widely used standard
as ".ini" files.
Why XML then? Simple. Because it's both easy
to read by humans -- and thanks to standard libraries available
in all popular languages -- easy to parse within the code. A
good example of this happening is a situation when you need
to persist your settings in an ASP application. In this case,
using global.asa just isn't good enough - application variables
expire because of inactivity, and the data is lost. Let's take
a look at an example when XML is used to build a typical configuration
file and persist the server hit count tally.
In most systems
today the key to information processing is its immediate availability
over the web. So instead of parsing XML data and storing it
in a temporary location (be it in memory, structured database
or files on the hard drive), XSL templates are used to format
XML data into HTML and present it to web clients right there
and then.
An XSL document is an XML-based template, which is
used by an XML parser to format XML data into HTML documents.
XSL syntax allows for such programming structures as loops and
conditional statements, but is mostly geared towards formatting
data for presentation rather than building business logic.
One of the most wonderful additions to the MSXML library (starting
with version 3.0) is the ServerXMLHTTP class. It allows for
seamless communications over the HTTP protocol from any language
that has integration with COM architecture. This includes ASP,
Visual Basic, C++, etc.
Because this component understands the
HTTP protocol syntax, most of the protocol communication functionality
is hidden from developers, thus allowing them to focus on business
logic.
Very often, ServerXMLHTTP acts as part of custom protocols
built between different tiers of applications. This logic virtually
eliminates the complexity of such sophisticated protocols as
RPC, RMI, DCOM, or CORBA, and yet still manages to mimic most
of the functional requirements of these protocols, and then
some.
It has a major advantage over all other protocols. Because
the server software is a standard HTTP web server, this type
of communication is not tied to any specific Operating System,
programming language or technology. Nor does it require any
additional software or special configurations on either one
of the tiers.
No Cure All
As with any other technology,
XML has its disadvantages and drawbacks. XML solves some development
hassle, but may create performance problems and lack of standards
across organizations. Correctly formatting data as XML increases
its size ten-fold or even more, which leaves very large XML
streams to be loaded into parsing components. Any significant
(by database standards) number of records would take seconds
to load in MSXML.
On the other hand, the freedom XML gives developers
in terms of syntax often backfires. Even within same organization,
the number of custom XML dictionaries (DTD's) can reach dozens,
most of them dealing with very similar problems.
It is true
that there are such standards as OFX (Open Financial exchange),
which is a set of XML tags that can represent any financial
information, but the industry is nowhere near to controlling
how developers manipulate XML tags within their applications.
Back to
XML Programming.
|
|