Serialization of Objects

  • Thread starter Thread starter Lucas Tam
  • Start date Start date
L

Lucas Tam

If I have an object that has the following structure:

SerializableObject
Several Private Variable
One Private CustomCollectionObject

Do I also need to make the CustomCollectionObject serializable as well, or
would making SerializableObject serializable be fine?

Basically does serializing SerializableObject imply that
CustomCollectionObject is serialized as well?

Thanks.
 
Making the outer class serializable implies that all its instance variables
will be serialized (unless you mark some of them as <NotSerializable()>.
However this does not mean that all variables will be _able_ to serialize.
In fact if some of them are not serializable by themself (their types are
not serializable), then not only those fields will not serialize, but the
whole class will not be able to serialize.

Vladimir [VB.NET team]


--------------------
| Newsgroups: microsoft.public.dotnet.languages.vb
| Subject: Serialization of Objects
| From: Lucas Tam <[email protected]>
| Organization: None of Your Business!!!
| Message-ID: <[email protected]>
| User-Agent: Xnews/06.02.16
| X-Face:
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xTbMCCP
'rF/EnVDK-y*a(Qh3J)+Fn]"/&@D(dOG=ITH!\afBA$O}D";gSvoEpfd
| Reply-To: (e-mail address removed)
| Lines: 18
| X-Complaints-To: (e-mail address removed)
| X-Complaints-Info: Please be sure to forward a copy of ALL headers
otherwise we will be unable to process your complaint properly.
| Date: Mon, 22 Sep 2003 22:03:49 GMT
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.sul.t-online.de!t-onlin
e.de!newsfeed.freenet.de!newsfeed.news2me.com!newsfeed2.easynews.com!easynew
s.com!easynews!easynews-local!news.easynews.com.POSTED!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:140417
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| If I have an object that has the following structure:
|
| SerializableObject
| Several Private Variable
| One Private CustomCollectionObject
|
| Do I also need to make the CustomCollectionObject serializable as well,
or
| would making SerializableObject serializable be fine?
|
| Basically does serializing SerializableObject imply that
| CustomCollectionObject is serialized as well?
|
| Thanks.
|
| --
| Lucas Tam ([email protected])
| Please delete "REMOVE" from the e-mail address when replying.
| http://members.ebay.com/aboutme/coolspot18/
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top