In general, structures should be used for managing the state (property
values - data) of something and classes should be used to manage state and
behavior (methods) of something.
Because structures are value types, they are managed on the stack as opposed
to classes, which are reference types and therefore managed on the heap.
Since the stack is a more limited storage area than the heap, thinner
objects are generally placed there and more complex objects (classes) go on
the heap, which is a bigger storage area.
Also, with value types (structures), you can easily pass them ByVal whereas
with a reference type (classes), you pass ByRef.
> Hi!
>
> I'd like to know is what are the prons and cons of using structures (data
> types declared as struct [in c#] or structure [in vb.net]) as against
> classes when passing data from and to a web service?
Hi,
There is no such difference from a Web Service point of view, since the data
sent over the web service is in XML format which is independent of being
generated from a class or struct.'
Regards,
Akila
[MVP]
Gian U. Uy - 29 Nov 2003 16:21 GMT
Thanks. This exactly answers my inquiry
> Hi,
>
[quoted text clipped - 5 lines]
> Akila
> [MVP]