← Prev in month ← Prev in thread
Next in thread → Next in month →

Attaching information with each Node

From
Ramkumar Menon <>
To
Date
2003-09-27T07:55:51Z
ID
<>
Thread
Attaching information with each Node
Hi,

My application is creating a DOM tree from a set of Nodes passed to it, 
one after another, at Runtime.Later, I would persist the tree to the 
database.
While I am recieving the nodes, I need to have some information attached 
with each of them for some processing. There are two ways I know of 
doing this.
1) Decorate the Node with an attribute that holds the information
2) Use the setProperty() method that holds the information.

If I am going with (1) ,then after I do the required processing, and 
before I persist the constructed DOM tree out of these nodes, I need to 
undecorate the tree . (i.e. remove the attributes, since the persisted 
tree should not have these temporary attributes. Also this post 
processing is expensive.
If I am going with (2), I find that the setProperty() implementation is 
a bit expensive too.

i.e.  for e.g.

For (1) for a node <employee>, the decorated node will be <employee 
custAttr="1">. Then based on this attribute, some processing is done. 
Later as a part of post processing the attribute is removed from the node.
For (2), for a node <employee> I would do 
employeeNode.setProperty("custAttr","1"); These would not appear in the 
persisted XMLValue. But again, this is expensive from profiling results.

Is there any othe more performing way of doing this ?
Any help will be appreciated.

thanks,
Ram.
-- 
Ramkumar Menon,
Oracle India Pvt Ltd,
No:3, Bannerghatta Road,
Bangalore - 82,
India.
← Prev in month ← Prev in thread
Next in thread → Next in month →