A good rule of thumb in addition to this is:

When in doubt, use an element.

People have philosophical disagreements about this issue, but at the very
least the limitation that an attribute can never have a >1 multiplicity
should dictate using an element if it is at all concievable that what you
are modeling could be multiple.




                                                                                
                                                      
                      Joseph Kesselman                                          
                                                      
                      <[EMAIL PROTECTED]        To:       [EMAIL PROTECTED]     
                                            
                      om>                      cc:                              
                                                      
                                               Subject:  Re: Elements vs 
Attributes Performance wise                                  
                      11/19/2002 10:50                                          
                                                      
                      AM                                                        
                                                      
                      Please respond to                                         
                                                      
                      xerces-j-user                                             
                                                      
                                                                                
                                                      
                                                                                
                                                      




Attributes have a bit of overhead for name-based lookup. On the other
hand, that may be faster than linearly searching children by name, if
that's what you want.

General advice is not to try to microoptimize on this basis. Use elements
for structure, or for things which must contain structure; use attributes
for simple-valued annotations that help describe that structure.

______________________________________
Joe Kesselman  / IBM Research

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to