|
YOUR FEEDBACK
Did you read today's front page stories & breaking news?
SYS-CON.TV |
TODAY'S TOP SOA & WEBSERVICES LINKS Java And XML Java and XML: The Promised Land
Java and XML: The Promised Land
By: Israel Hilerio
Feb. 28, 2000 12:00 AM
Welcome to Java and XML - the promised land. In the context of these two technologies the promised land presents a series of solutions in which the marriage between Java and XML has provided an optimal answer for solving distributed multiplatform problems. But do XML and Java actually pave the road to data interchange nirvana? Let's embark on a journey to analyze and evaluate the hype and the reality of the solutions offered by the combination of these technologies. Throughout this journey we'll explore the architectural merits associated with deploying these solutions. In this column I'd like to present how these two technologies, Java and XML, can be combined to help you achieve your own personal path to the promised land. Some of the areas we'll cover in this column are:
If you'd like to see other topics in this column, please e-mail me and I'll try to address them. This article will introduce you to the strengths and characteristics of the Java and XML marriage. I'll concentrate on related technologies such as DOM, SAX and DTDs - technologies that help provide a comprehensive solution using XML and Java. In the following issues you'll see a lot more coverage on Java itself.
Java & XML
In the J2EE environment the support for IIOP over RMI (Remote Method Invocation), the evolution of the JMS (Java Messaging Services) and the evolution of adapters for the JavaMail API have created a stable communications pipe in which information can be exchanged reliably in a heterogeneous environment. This communication pipe provides a standard conduit for passing XML information. In a very short time XML has evolved to become the de facto standard for data manipulation between enterprise- and Internet-enabled applications. The programmatic tools that have contributed to the proliferation of XML technologies in enterprise applications are parsers. The two main parser technologies are the DOM (Document Object Model) and SAX (Simple API for XML) APIs. Other XML technologies have contributed to the acceptance of the language as well. Some of the most popular technologies are XSL for data viewing, DTD for data verification, XML databases for permanent storage, XML integration servers for business-to-business interaction and the evolution of HTML (4.0) to an XML-compliant format. We'll come back to DOM, SAX and DTDs later in this article.
The Java - XML Highway As you can see from these examples, XML can be used as input or output for another application while Java can be used as the producer or consumer of the data produced by XML.
Beyond Java Adapters allow applications or components built for one system to be used in another system. This is accomplished by creating a wrapper interface that acts as a translator of information between the new interfaces and the existing class interfaces. One area where we can leverage XML-based adapters for manipulating legacy data is EDI transactions. EDI transactions are hierarchical formatted files that contain information encoded using standard predefined tags. XML can be considered a superset of EDI. By using XML as such, we can store additional information on how to handle the information contained inside an EDI transaction (see Figure 2). This information can consist of sender as well as recipient information, and include details on the priority of the information, special care for instructions associated with the transaction's content and other items not normally stored as part of transaction information.
Back to Java There are clear situations when you need to use a hierarchical tree view of the document. This will be done using the DOM API. One of those situations is when you need to search information inside a document and the tags in the hierarchy contain semantic information. This would be the case if you were looking for all the models of Ford trucks that carry blue tones (see Figure 3A). Just finding the blue attribute inside the truck model won't be particularly meaningful. However, finding it inside the Excursion, Expedition and Explorer lets us know that these are Ford trucks with blue tones (see Figure 3B). Notice that the F-150 truck doesn't carry any blue attributes and thus isn't part of the resultset, nor are there any cars in the resultset although the cars tag has a blue attribute. In some situations you just need to know the occurrence of a tag. This is done using the SAX API. One situation in which the hierarchy of the document isn't of immediate importance is when there are key tags that can trigger the execution of separate processes. This would be the case if you were looking for the Urgent attribute inside any item in a purchase order (see Figure 4).
The two previous approaches can be combined to allow the distribution of work through different process paths based on specific tags' names or attributes (SAX API). This is similar to the processing of urgent orders through a specialized queue based on the attribute information contained inside the item tag. Once the purchase order has been selected, the semantic information contained by the document hierarchy becomes valuable for processing the content of the order (DOM API). In this column you've seen one of the major programmatic areas where Java and XML can work together hand in hand to allow processing of information from external systems. The XML and Java technologies are parser based and leverage document hierarchies and attributes to retrieve semantic information about the information contained inside the tag. Using these two approaches you can build systems that leverage workflow engines to tailor the processing of information. YOUR FEEDBACK
XML JOURNAL LATEST STORIES . . .
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
|
SYS-CON FEATURED WHITEPAPERS MOST READ THIS WEEK BREAKING XML NEWS
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||