Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / July 2005

Tip: Looking for answers? Try searching our database.

Class v. Structure

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Just Me - 25 Jul 2005 14:51 GMT
Is there any performance considerations for a web service returning a
structure versus an instance of a class?
Michael Nemtsev - 25 Jul 2005 15:42 GMT
Hello Just,

JM> Is there any performance considerations for a web service returning
JM> a structure versus an instance of a class?

Seems not, coz both of them need to be serialized

---
WBR,
Michael  Nemtsev
Just Me - 25 Jul 2005 15:58 GMT
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.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.