|
ADOMs (Application Data Object Model) are hierarchical memory data objects that are maintained in Request, Session and Application scopes by MoreMotion. MoreMotion automatically converts the data existing in an ADOM to XML if a dynamic page to be displayed has a reference to it.
MoreMotion provides an API to application programmers to maintain (create, update, delete, etc.) ADOM objects . Here is an example:
/* Create a new ADOM */
ADOM order = request.newRequestADOM("order");
/* 1. item */
ADOMNode orderItem = new ADOMNode("item");
orderItem.addAttribute("id","1");
orderItem.setNodeValue("PROD_ID","17");
orderItem.setNodeValue("QUANTITY_ID","3");
order.addNode(orderItem);
/* 2. item */
ADOMNode orderItem = new ADOMNode("item");
orderItem.addAttribute("id","2");
orderItem.setNodeValue("PROD_ID","45");
orderItem.setNodeValue("QUANTITY_ID","5");
order.addNode(orderItem);
|
This code will create the following Objects:

ADOMs are Datasources
If a dynamic page has a reference, for instance, to "order" Datasource, MoreMotion will create a datasource by converting "order" ADOM to XML as it seen below.
<order>
<item id="1">
<PROD_ID>17</PROD_ID>
<QUANTITY>3</QUANTITY>
</item>
<item id="2">
<PROD_ID>45</PROD_ID>
<QUANTITY>5</QUANTITY>
</item>
</order>
|
The duration of an ADOM is determined by its scope. An ADOM created in Request scope is purged from the memory when the current request is processed and the response is sent to the client. A Session ADOM is kept in memory as long as the user's session is active and an Appication ADOM is shared by all the users of the web application and it lasts until the web application is shut down.
ADOM Elements

|
ADOM Elements that are available on library branch mor > ADOM lets us maintain ADOMs in Process Management Framework.
ADOM Management Language can be used in AML property of the AMLProcess element to simply create/clear ADOMs, insert/update/delete nodes to them without having to write Java classes.
|
Although we can give any name to an ADOM Node or we can construct the ADOM's hieararchy as we want by using MoreMotion API, there are some limitations and considerations that apply when accessing and manipulating them with AML( ADOM Management Language).
Here they are:
| 1. | AML assumes that the nodes existing in an ADOM are structured as two-level hierarchy that is suitable to store the relational table records. Item nodes of ADOM corresponds to the relational table records.
|
| 2. | Where a relational table record has fields, the item node has child nodes. For example PROD_ID field of a record is represented by PROD_ID child node of the item node. |
Relational Table:

ADOM:
<order>
<item id="1"> <!-- item node = Record -->
<PROD_ID>17</PROD_ID> <!-- sub node = Record Field -->
<QUANTITY>3</QUANTITY>
</item>
<item id="2">
<PROD_ID>45</PROD_ID>
<QUANTITY>5</QUANTITY>
</item>
</order>
|
| 3. | Where MoreMotion API lets us to operate on every single ADOM node individually, ADOM Process Elements can only operate on "item" nodes. For example AML Insert function inserts a new "item" node together with its child nodes or AML Delete function deletes an existing "item" node, again, together with its child nodes.
|
|