axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksander Slominski <as...@cs.indiana.edu>
Subject Re: use of immutable value object/interfaces [Re: [Axis2] OM API review/changes
Date Fri, 22 Oct 2004 16:20:06 GMT
Sanjiva Weerawarana wrote:

>Hi Alek,
>
>  
>
>>if OMAttribute is immutable (so called value object) then once created 
>>the attribute can be shared safely and used when generating output in 
>>*multiple* threads! i think it is big gain when we have to generate 
>>again and again very similar looking SOAP messages ...
>>    
>>
>
>We're talking about making the entire OMAttribute immudatble right?
>  
>
yes

>That is, namespace name, local name, and value (and possibly later
>stuff like type etc.)?
>  
>
yes - whole attribute is a value object.

>In that case what are the scenarios where the *same* attribute is
>used repeatedly in multiple messages (obviously it can't be in
>the same message as an attribute cannot be held simultaneously
>by two elements)?
>
if attribute is an immutable value object then it can be held 
simultaneously by multiple elements assuming you do not add parent 
property into attribute ....

usage will depend how attribute heavy are your message or headers.

if you have messages that use lot of enumerated attribute values you 
gain - one example of such type of XML is WS-Security. here is  small 
snippet taken from a typical message (i do not want to reproduce whole 
few pages long XML ...):

     <ds:Reference URI='#action' >
      <ds:Transforms>
       <ds:Transform Algorithm='http://www.w3.org/2001/10/xml-exc-c14n#' 
/>        
      </ds:Transforms>
      <ds:DigestMethod  
Algorithm='http://www.w3.org/2000/09/xmldsig#sha1' />
      <ds:DigestValue>AAAAABBBBBBB==</ds:DigestValue>
     </ds:Reference>

     <ds:Reference URI='#to' >
      <ds:Transforms>
       <ds:Transform Algorithm='http://www.w3.org/2001/10/xml-exc-c14n#' 
/>        
      </ds:Transforms>
      <ds:DigestMethod  
Algorithm='http://www.w3.org/2000/09/xmldsig#sha1' />
      <ds:DigestValue>AAAAACCCCBB==</ds:DigestValue>
     </ds:Reference>


as you can see URI and Algorithm attributes are essentially constants 
and it would be good to be able to reuse them (similarly to how String 
can be reused and garbage collected when not needed) for multiple 
message that will have signature on action header, destination header, 
and so on (so maybe even *all* secure messages ...)

>I am definitely interested in the re-use idea (with its implied 
>memory and time performance improvement) but not sure whether it
>occurs often.
>  
>
as far as i can see there is no penalty - if reuse happens you gain 
otherwise you loose nothing?

thanks,

alek

-- 
The best way to predict the future is to invent it - Alan Kay


Mime
View raw message