BML Design overview

Author: Anders W. Tell
Version: 0.40 
$Id: BML-design_040.html,v 1.2 2001/08/13 16:23:28 anderst Exp $

  This document describes the design of BML's major interface techniques and API's
 

NOTE: The PVIS (Post Validation Information Set) is currently not scheduled to be implemented.

Representations

The information model on which XML is based may be represented in various ways. BML implements four complementary types of representations.

Markup levels

  1. Data only
  2. Above + markup that separates data atoms
  3. Above + schema for a representation. [BML]

Datatyping

Datatyping is a parallel characteristic to markup levels.
 
   Stream 

The stream representation corresponds to XML 1.0  text format which may be stored in files. However BML streams consists of a sequence of binary tokens.

  • One big benefit of using binary tokens is speed. Reading binary tokens may improve performance by a factor of x10 or more.
  • Another benefit is size, binary stream may save 10% up to 80% (relative to corresponding XML text stream) depending on how and what information is encoded in the stream. 
  • The use of XML Schema datatypes increases the relative performance gain, compared to XML text.
  • The major drawback is that binary streams are not readable by humans (unless it is converted back to XML text).  However for many applications this is not necessary, examples are B2B communication and remote procedure calls where 99.99...% of all messages are never read by humans.
Streams are constructed using a software component which implements a stream Writer interface.


 
 
  Eventhandler 
The next representation is dynamic and consists of a series of method calls to a callback software component implementing a Eventhandler interface, which corresponds to the commonly used SAX technology.
 


 
 
 
   Tokenstream 
The next representation is static and consists of a sequence of Tokens stored in a TokenStream component. Each Token corresponds to a binary stream token. It is possible to view the representation as a pre tokenized stream.
 


 
 
   Tree 
The next representation is static and consists of a tree with nodes corresponding to XML information items. The design differs significantly from W3C DOM trees where direct access is allowed to individual nodes in a tree, this is not allowed in BML tree's.
All access is centralized to a Iterator or treewalker interface which means that internal details of how the tree is constructed are hidden. Iterators and Mutators are created from a Document which is a facade for any datastructure that may be viewed as a tree.

This design ...

  • allows for a greater flexibility when adding tree access to an information model.
  • usually creates smaller trees with fewer objects.
  • allows for faster remote access to document trees because the client side needs only access to 2 component , Iterator and Document, and not every node in the tree.
  • makes it possible to view many datastructure  as trees without conversion to and from a generic tree representation.

 


 



BML Design