Main Page | Report this Page
Computers Forum Index  »  Computer - Object (Corba)  »  Union or any...
Page 1 of 1    

Union or any...

Author Message
Bogdan Jeram...
Posted: Thu Mar 12, 2009 4:52 pm
Guest
Hi,

I have to solve a problem to solve an arbitrary data (actually there are
several types) from a client to the server, and I am in dilemma should I
use IDL union or IDL any for solving the problem.

What is better to use (any or union) in terms of network traffic and CPU
usage (marshaling/marshaling) ?

Thanks
Bogdan
 
Douglas C. Schmidt...
Posted: Thu Mar 12, 2009 4:52 pm
Guest
Hi Bogdan,

Quote:
I have to solve a problem to solve an arbitrary data (actually there are
several types) from a client to the server, and I am in dilemma should I
use IDL union or IDL any for solving the problem.

What is better to use (any or union) in terms of network traffic and CPU
usage (marshaling/marshaling) ?

unions will generally be better since they send less metadata and are
usually faster to marshal/demarshal.

Doug
--
Dr. Douglas C. Schmidt Professor and Associate Chair
Electrical Engineering and Computer Science TEL: (615) 343-8197
Vanderbilt University WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203 NET: d.schmidt at (no spam) vanderbilt.edu
 
Jon Biggar...
Posted: Thu Mar 12, 2009 9:09 pm
Guest
Bogdan Jeram wrote:
Quote:
Hi,

I have to solve a problem to solve an arbitrary data (actually there are
several types) from a client to the server, and I am in dilemma should I
use IDL union or IDL any for solving the problem.

What is better to use (any or union) in terms of network traffic and CPU
usage (marshaling/marshaling) ?

If the number of types you need to support isn't too large (a half dozen
or so), and you don't project that future evolution of your interface
will require adding more types, then go with a union, since it's more
efficient on the wire.

You can also go with a hybrid approach, where you have a union for
simple times (number, strings) and have an "other" choice in the union
that uses an any. Then for simple datatypes you don't have the wire
overhead of the any, but you still have the option in the future to use
it without having to change your IDL.

--
Jon Biggar
jon at (no spam) biggar.org
jon at (no spam) floorboard.com
 
 
Page 1 of 1    
All times are GMT
The time now is Fri Dec 11, 2009 6:31 am