Methods do not get serialized so it would seem more straighforward,
clearer, more inutitive, etc. in reading the code to use structures.
I know in .Net, structures can have methods, but I've used them in the
past strictly for grouping relate elements/data types.
The differentiation I'm thinking of that may be pertinent to performance
is that structures are created on the stack versus on the heap for class
instances. My guess is that for small sets of data, perhaps the
structure is better and the opposite is true for returning large sets of
data. I really do not know.
I have not found any discussion of such in MSDN or otherwise. I'm
curious to know if anyone has any remotely conclusive evidence or
experience. Thanks.
Michael Nemtsev - 25 Jul 2005 16:11 GMT
Hello Just,
JM> The differentiation I'm thinking of that may be pertinent to
JM> performance is that structures are created on the stack versus on
JM> the heap for class instances. My guess is that for small sets of
JM> data, perhaps the structure is better and the opposite is true for
JM> returning large sets of data. I really do not know.
Yep, everything is all right as u described.
it depends on how u treats that data afterwards u get them? If it's in vast
using - use class,
if it's only returning data with short period of life - use stucture.
Web-service doesnt' have sense in this way
---
WBR,
Michael Nemtsev
Just Me - 27 Jul 2005 14:43 GMT
Thank you for your replies and confirming my thoughts. Best regards.