Mies Design Overview
The BDO editor is a Swing based graphical editor with which Business Data Objects (BDOs) can be created and maintained. The editor benefits greatly when used with a UML information model (for example, that used by the Louis component) but will function without such a model.
A BDO is viewed and edited as a directed graph of Composite objects. A Composite has attributes and parent?child relationships to other Composites. A Composite normally is logically attached to an object found in the information model and it is common that the attributes of such a Composite is connected to corresponding attributes of its attached object. The attributes may reflect an arbitrary expression, provided this expression is valid in a projection of a select statement (with respect to the JDBC driver in use). Expressions that are aggregations or computed values will result in read-only attributes.
In the graph, the user can also assign special "collaborators" that control the behavior of the parent-child relationships, thus describing the semantics of changes made to the graph. (Note: changing a value might imply a change of the existing node, a perhaps a lookup of another node. A lookup failure might imply a new node or should cause an error. More cases exist).
The resulting BDO definition is stored as XML directly usable by the Mies runtime component.
The Mies runtime utilizes BDO definitions both when reading data from the information model and when committing changes back to the model.
The BDO class will invoke the SAX Event 1) generator, which in turn forms an optimal query that it executes using JDBC. The result is then automatically converted to a series of SAX events.
Depending on use, those events can be used in one of two ways:
Sent directly to an event receiver that will use the events for an arbitrary purpose (such as XSL Transformations and content rendering).
Sent to a DOM Document builder, which builds a document, attaches it to the Transactional DOM component, and wraps it in a Business Data Object instance.
The first use is optimal in all cases where the objective is to produce information that will not be directly edited. Since no state is preserved, the Mies runtime will maximize the gains obtained by using EJB Stateless Session Beans. The second use is intended for application logic that benefits from an in-memory, updateable object instance.
Changing and storing a BDO
The BDO forms a closure for all changes made to it. All updates are tracked by the Transactional DOM implementation. Checkpoints can be set at any time so that complex update operations can be partially rolled back (in memory), if so desired. No database access will be made until an explicit "save call" is issued to the BDO or the transaction in which the BDO has registered committed.
When a BDO is saved, the Transactional DOM will send all changes made to the BDO to a Commit Handler. This handler determines the optimal way to store these changes into the database using DML statements, based on very advanced logic that will handle the order of execution of those statements, the pre-fetch of sequence values and the generation of Object Identifiers.
Data sources in use by Mies
At present, the only possible data source is JDBC. Versions under develpment include support for JCA, WebServices, and plain files.
Mies includes a simple BDO dump utility (bodump) that enables XML streaming of the data from any given BDO. A BDO store utility (bostore) is currently being developed.
The Mies runtime is configured using a Java Management eXtensions (JMX) bean. An XML format is used that allows configuration of various data sources.
1) SAX stands for Simple API for XML. It is a de-facto standard interface for an XML parser to turn an XML document into a sequence of events, such as "encountered start tag ", "encountered text", and so on.