Newsletter sign-up
View all newsletters

Sign up for our technology specific newsletters.

Enterprise Java
Email Address:

Process XML with JavaBeans, Part 1

Interconnect JavaBeans to process XML

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
The expression "eating your own dog food" has gained currency over the last few years. It means taking the product you're selling in your daily business and using it yourself, so that you understand it from the consumer's point of view. I've been churning out columns on JavaBeans (my particular brand of dog food) for the last couple of years, teaching readers how to create new JavaBeans and use them in novel ways. But I haven't focused on using JavaBeans in applications -- I haven't been eating my own dog food. And it's about time I sat down to a big chunky bowl of it.



With that in mind, this month I am going to cover not how to create JavaBeans, but how to use them. Using JavaBeans to create applications in an integrated development environment (IDE) is a great way to learn how to think in components. Component designers and implementers who are forced to chow down on what they've been dishing up quickly learn what makes a component useful -- or useless. Many developers who assemble JavaBeans into running applications have experience primarily with GUI components; thus, in this series, I'll particularly focus on components that do data processing and have no runtime user interface.

The software package I'll be using for this discussion is IBM's XML Bean Suite, available for free from IBM's alphaBeans site (see Resources for a link). This package is very different from the XML JavaBeans and BML I've covered in the past. Those discussions dealt with converting JavaBean components to XML, or creating JavaBeans from XML. The XML Bean Suite, on the other hand, is a set of JavaBean components designed for processing XML data. The suite contains JavaBeans that a developer interconnects visually in an IDE in order to read, write, display, search, and filter XML data. Many of these JavaBeans have no user interface at runtime; they do most of the application's work internally. They're also excellent design examples of how to encapsulate functionality into a component.

This article assumes that you're familiar with the basics of JavaBeans and XML. Links to background material for this article appear in the Resources section.

This month's column is mostly an overview of the XML Bean Suite, which contains a large number of classes for processing XML. I'll also discuss how IDEs interconnect JavaBeans in response to your input, and I'll point out useful design principles as we go along. Columns to follow will use the XML bean classes to create applications (such as an XML file editor) that process XML data.

Contents of the XML Bean Suite

The alphaBeans site (see Resources) is the JavaBeans section of IBM's alphaWorks site, which provides "early adopter developers direct access to IBM's emerging 'alpha-code' technologies." This means that the code is freely downloadable from the site. Some of the code is even available for free commercial use, but the licensing restrictions vary by package. The designation alpha also means that the software is not ready for prime time. APIs are not guaranteed to be stable, the software may be updated erratically, and IBM makes no guarantees about ever turning the material on alphaWorks (and alphaBeans) into commercial products. Still, several projects that began on alphaWorks have graduated to full commercial status. Most, if not all, alphaWorks technologies have online discussion forums where users can get advice from the developers creating the software, and can make suggestions for improving the products.

The XML Bean Suite is a set of 39 Java classes available for free from the alphaBeans site. Since it's alpha software, it doesn't yet work with the latest version of Swing (it requires Swing 1.0.2), and doesn't even work with the newest version of IBM's XML processor xml4j (it requires version 1.1.4). The license agreement that appears at download time grants redistribution rights to the code (though you shouldn't take my word for it -- read the license yourself).

  • Digg
  • Reddit
  • SlashDot
  • Stumble
  • del.icio.us
  • Technorati
  • dzone
Comment
Login
Forgot your account info?
Add comment
Anonymous comments subject to approval. Register here for member benefits.
Have a JavaWorld account? Log in here. Register now for a free account.
Resources
Download the source code for this article XML and XML JavaBeans Suite resources