What Is AXIOM?
AXIOM stands for AXis2 Object Model and refers to the XML infoset model that was initially developed as part of Apache Axis2, but later it moved to a WS commons project. Axiom is the main XML representation mechanism in Axis2, so any message coming to Axis2 will be represented as an Axiom object in Axis2. XML infoset refers to the information included inside the XML, and for programmatic manipulation it is convenient to have a representation of this XML infoset in a language specific manner. For an object-oriented language, the obvious choice is a model made up of objects. DOM and JDOM are two classic examples for such XML models. AXIOM is conceptually similar to such a XML model by its external behaviour, but deep down it is very different.
AXIOM is a lightweight, deferred built XML infoset representation based on StAX, which is the standard streaming pull parser API. The object model can be manipulated flexibly as any other object model (such as JDOM), but underneath, the objects will be created only when they are absolutely required. This leads to much less memory-intensive programming. This also is very useful when it comes to applications such as message routing and ESB (Enterprise Service Bus).
Among the features of AXIOM, deferred building can be considered as the best. That also was one of the design goals of AXIOM. As you have seen in Axis2-related articles, one of the issues of Apache Axis1 was its XML representation. It was fully based on DOM, and it loads full messages for processing; this become a performance killer when it came to large messages. AXIOM was introduced to solve those issues, and in addition to that it has following key features as well.
- Lightweight: AXIOM is specifically targeted to be lightweight. This is achieved by reducing the depth of the hierarchy, number of methods, and the attributes enclosed in the objects. This makes the objects less memory intensive.
- Deferred building: The objects are not made unless a need arises for them. This passes the control of building over to the object model itself rather than an external builder.
- Pull based: For a deferred building mechanism, a pull-based parser is required. AXIOM is based on StAX, the standard pull parser API.
What Are Pull Parsing and Push Parsing?
Read the Rest of this Article at Developer.com