Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Returning Objects

Reply
Thread Tools

Returning Objects

 
 
SS IT Services LLC
Guest
Posts: n/a
 
      12-19-2008
Is it a bad practice to return strong typed class objects from my
webservice?

If so, what is the preferred option.


--
Scott
SS IT Services, LLC

 
Reply With Quote
 
 
 
 
John Saunders
Guest
Posts: n/a
 
      12-21-2008
"SS IT Services LLC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is it a bad practice to return strong typed class objects from my
> webservice?
>
> If so, what is the preferred option.


No. That's the preferred option, assuming you understand what it means.
Although you will be _returning_ those types, you will not be _sending_
them, and your clients will not be _receiving_ them.

When you return any type, including a primitive type like string, you will
be sending XML back to the client. In many cases, the client will
deserialize this XML into an instance of some proxy type - a type that makes
it easier for the client to access the deserialized XML. This will not be
the same type you sent, so that type will not have any of the methods of
your original type.

Also, you should not return platform-specific types, as those types may well
not exist on the platform being used by the client. In particular, do not
return DataSet or DataTable.

John


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
class objects, method objects, function objects 7stud Python 11 03-20-2007 06:05 PM
returning none when it should be returning a list? randomtalk@gmail.com Python 11 05-02-2006 10:26 AM
Java variable scope question (returning objects and private methods) exquisitus Java 6 02-22-2005 04:05 PM
Newbie Q: returning objects from the freestore Scott C++ 4 10-12-2003 08:09 PM
HELP: Passing and Returning Objects using JNI Vikas Java 2 08-27-2003 12:37 PM



Advertisments