YOUR FEEDBACK
Werner Keil wrote: Java 6 update 10. If I'd be running Apple, I'd probably really drop dead...
AJAXWorld RIA Conference
$300 Savings Expire September 5th. Register Today and SAVE!


2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
SYS-CON.TV
TODAY'S TOP SOA & WEBSERVICES LINKS


Java and XML: The Promised Land
Java and XML: The Promised Land

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:

  • The use of XML files as deployment descriptors for Java applications and their use as more sophisticated forms of property files
  • The use and advantages of XML databases as persistence storage for Java applications and how Java programs can leverage them
  • The use of XML tagging to describe the data content of JMS messages, i.e., a serialization and deserialization strategy for JMS messages
  • The use of XML to describe the services provided by a mobile agent, i.e., the use of XML repositories as interface warehouses to discover the behavior contained by mobile agents

    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
    The Java platform has evolved to become the de facto standard when deploying enterprise-wide Internet-enabled solutions. Recently, the introduction of the J2EE (Java 2 Platform, Enterprise Edition) has helped to standardize the application server environment by providing a reference platform for developers to build enterprise solutions. J2EE has extension APIs that address the development of distributed enterprise solutions. The set of APIs includes:

  • JDBC for database access
  • RMI for distributed Java communications
  • Java IDL for distributed CORBA communications
  • Servlets for Web server-side applications
  • JNDI for name and directory service access
  • JMS for asynchronous message communications
  • EJB for developing enterprise application components in a distributed fashion

    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
    Let's take the analogy of a highway. In its most basic form you can think of the Java platform as the provider of the highway and XML as the cars. The Java platform provides the bridges, intersections and tollgates for the cars to drive through. XML provides a standard definition of what a car is. One definition is that it must have four wheels, a chassis with at least two doors, an engine, a steering wheel and, at a minimum, one car seat with a seat belt. While these are concrete components, there are other ways in which these technologies can be combined to achieve ideal results. Imagine the Java platform as the automobile builder and XML as the blueprint for building the car. Using this combination, the output produced by the Java factory is controlled by the XML input but the output itself doesn't have to be XML specific. However, if we combine these two approaches, we can see how XML can be used as the blueprint in the Java factory, how the Java factory produces XML-defined cars and how those cars can move from one location to another using the Java-enabled communications highway. This highway can be implemented using a combination of e-mail, IIOP, JRMP or JMS (see Figure 1).

    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
    Up to this point I've concentrated solely on Java and XML - after all, that's the title of this column! However, the real power of XML is that its creation can proceed from any producer application; such applications need not be Java based. Similarly, the consumption of XML information can take place using applications that aren't Java based. Legacy applications can also share information with XML consumers and producers by leveraging the adapter design pattern and providing applications that transform the legacy data into XML bidirectional streams.

    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
    The Java language facilitates the creation of adapters by providing a platform that can be used on heterogeneous operating systems for parsing and creating XML documents. The two main APIs used for this purpose are the DOM and SAX APIs, introduced earlier. The DOM API provides a treelike representation of the hierarchical data. The application code traverses the tree by accessing tags contained in the document hierarchy. Once the specific tag is encountered, the attributes, data and text associated with the tag can be accessed. Developers using the DOM are normally concerned with the hierarchy and structure of the document. The SAX API provides an event-driven mechanism that allows applications to search for a specific tag independent of the document hierarchy. One of the characteristics of this approach is that the only information available when a tag is reached is the name of the tag and its attributes. The textual information associated with the tag isn't accessible directly. Developers using the SAX are normally concerned with the tags contained inside the document.

    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).

    One of the items in the purchase order marked Urgent could be computer memory. It doesn't matter that the memory item is contained inside the computer equipment hierarchy. What is important is that the memory item has an attribute of type Urgent. Finding the Urgent tag in any of the items will allow the purchase order to be processed through a priority queue.

    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.

    About Israel Hilerio
    Israel Hilerio is a program manager at Microsoft in the Windows Workflow Foundation team. He has 15+ years of development experience doing business applications and has a PhD in Computer Science.

  • YOUR FEEDBACK
    AJAX news desk wrote: TIBCO's AJAX Technology has been honored with an InfoWorld 100 Award for its creative use of TIBCO General Interface Framework. Iconix Pharmaceuticals' leveraged TIBCO's AJAX solution to develop and power an intuitive, high productivity graphical user interface (GUI) for its comprehensive DrugMatrix database.
    ajax news desk wrote: Iconix Pharmaceuticals Wins InfoWorld 100 Award for Innovative Use of TIBCO's AJAX Technology has been honored with an InfoWorld 100 Award for its creative use of TIBCO General Interface Framework. Iconix Pharmaceuticals' leveraged TIBCO's AJAX solution to develop and power an intuitive, high productivity graphical user interface (GUI) for its comprehensive DrugMatrix database.
    XML JOURNAL LATEST STORIES . . .
    To be able to do anything useful, an ESB must be configured with all sorts of parameters, from endpoint connection URIs to message transformation scripts to content-based routing definitions. Moreover, ESBs like Mule can host custom components, which will process messages and perform u...
    Representatives of the state IT organizations of Brazil, South Africa and Venezuela, three of the four countries that protested ISO’s standardization of Microsoft’s Office Open XML (OOXML) file format, have apparently thrown in the towel on taking their appeal any further. India, t...
    Two of the biggest launches in Rich Internet Application history took place in 2007/2008 when Adobe launched AIR 1.0 in February '08 and Microsoft launched Silverlight (September '07). At the 6th International AJAXWorld RIA Conference & Expo in October SYS-CON Events is delighted to be...
    Red Hat CTO Brian Stevens, Citrix CTO Simon Crosby, Egenera CTO Pete Manca, Allen Stewart, Group Manager, Windows Virtualization at Microsoft, and Brian Duckering, Sr. Director of Products and Alliances at Symantec were the top industry executives who joined Jeremy Geelan in the 4th Fl...
    This article is aimed at beginner and intermediate Web developers looking to make the leap into database support of their Web site. The article suggests a new declarative language based on HTML-forms, which is used for development of the database interface. HTML forms can manage not on...
    SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
    SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
    Click to Add our RSS Feeds to the Service of Your Choice:
    Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
    myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
    Publish Your Article! Please send it to editorial(at)sys-con.com!

    Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021


    SYS-CON FEATURED WHITEPAPERS


    ADS BY GOOGLE
    BREAKING XML NEWS

    Security Challenges for the Information Society