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 / .NET Framework / Remoting / December 2004

Tip: Looking for answers? Try searching our database.

Serialization question with remoting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ron - 23 Dec 2004 20:58 GMT
If I have a singleton with a method that returns an object to the client,
will all data including Attributes and Inherited objects be serialized as
well?
All attributes and classes are marked as [Serializable()]

Thanks!
Ron,
Ken Kolda - 23 Dec 2004 22:33 GMT
Attributes aren't really data for the class -- they're metadata. So they do
not get passed across the wire. What the server passes in a ObjRef that
contains the class name and the interfaces it implements to the client. I'm
not sure what you mean by "inherited objects".

You best bet is to see for yourself what gets passed. Once you get the
object on the client side, use RemotingServices.GetObjRefForProxy() to get
the ObjRef that was passed from the server. Then use the SoapFormatter to
serialize this to disk. You can then open it in notepad and see exactly what
gets passed.

ken

> If I have a singleton with a method that returns an object to the client,
> will all data including Attributes and Inherited objects be serialized as
[quoted text clipped - 3 lines]
> Thanks!
> Ron,
Ken Kolda - 23 Dec 2004 22:43 GMT
Sorry -- just re-read your post. Since the object is serializable, there's
no ObjRef. The object is serialized and passed down in its entirety.
However, attributes aren't serialized bevause they're not instance-specific.
I'm still not sure what you mean by "inherited objects", but if you mean the
fields of base classes, then yes those are also serialized.

Ken

> Attributes aren't really data for the class -- they're metadata. So they do
> not get passed across the wire. What the server passes in a ObjRef that
[quoted text clipped - 16 lines]
> > Thanks!
> > Ron,
Ron - 24 Dec 2004 18:30 GMT
Thansk Ken for the help

Concerning the attribute,  the Attribute is a custom attribute class which
is also marked with the [Serialization()] attribute.  The attribute contains
two public properties.
So the attribute (and properties of) will not be serialized at all to the
client?

Thansk!

> Sorry -- just re-read your post. Since the object is serializable, there's
> no ObjRef. The object is serialized and passed down in its entirety.
[quoted text clipped - 29 lines]
> > > Thanks!
> > > Ron,
Ken Kolda - 27 Dec 2004 16:24 GMT
The attribute will not be serialized. Attributes should be considered part
of the definition of the type, not instance data. So, just as the
serialization doesn't serialize the method definitions and the entire type
of teh stream, the attributes would not be serialized either.

Ken

> Thansk Ken for the help
>
[quoted text clipped - 43 lines]
> > > > Thanks!
> > > > Ron,
Ron - 27 Dec 2004 17:09 GMT
Thanks,

> The attribute will not be serialized. Attributes should be considered part
> of the definition of the type, not instance data. So, just as the
[quoted text clipped - 57 lines]
> > > > > Thanks!
> > > > > Ron,

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.