473,513 Members | 2,558 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Serialization of Objects

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 (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 20 '05 #1
1 1528

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 <RE********@rogers.com>
| Organization: None of Your Business!!!
| Message-ID: <Xn***************************@140.99.99.130>
| User-Agent: Xnews/06.02.16
| X-Face:
#gFwhH/LPM9"eq<Dzb3~[P'7%dS98vHkcFbX;SjezglosS.OP?:tzhHT7o=G03o0%St#;xT bMCCP
'rF/EnVDK-y*a(Qh3J)+Fn]"/&@D(dOG=ITH!\afBA$O}D";gSvoEpfd
| Reply-To: RE********@rogers.com
| Lines: 18
| X-Complaints-To: ab***@easynews.com
| 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!newsfeed 00.sul.t-online.de!t-onlin
e.de!newsfeed.freenet.de!newsfeed.news2me.com!news feed2.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 (RE********@rogers.com)
| Please delete "REMOVE" from the e-mail address when replying.
| http://members.ebay.com/aboutme/coolspot18/
|

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
4946
by: Ben | last post by:
Hi, there. Recently I was working on a problem where we want to save generic closures in a data structure (a vector). The closure should work for any data type and any method with pre-defined...
4
3121
by: Jeff T. | last post by:
Hello, I have an existing set of C# classes that encapsulate our application data. They are in a heirachy with each subclass defining more specific types of data. I would like to serialize these...
2
1632
by: Ray Mitchell | last post by:
Hello, I am currently doing default serialization of various objects and I am aware that the simplest way to do serialization between assemblies is to put the objects to be serialized in a...
6
2703
by: Uttam | last post by:
Hello, We are at a very crucial decision making stage to select between .Net and Java. Our requirement is to download a class at runtime on the client computer and execute it using remoting or...
2
2579
by: Maximus | last post by:
Hi Everyone, I was using Inprocess session objects, but incase of aspnet process crashes the session objects were lost as a result I decided to shift to out of porocess session objects. For this...
8
315
by: vinay | last post by:
Hi Guys I want to understand Serialization. What is serialization. When do we need to use?? What are advantages and Disadvantages. Also please diret me to some good sites on serialization....
0
1238
by: Goethals Frederik | last post by:
Hi, I have some questions that are a little difficult to explain, so I give it a try... I have an application (aSP.NET with VB.NET codebehind) and I would like to store my data on disk...
8
12542
by: =?Utf-8?B?UGlnZ3k=?= | last post by:
Hi to all, I am getting this System.OutOfMemoryException calling the Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(<stream>,<Obj>) method. The type of <streamis...
0
4697
by: JosAH | last post by:
Introduction Upon hearing the word, "Serialization", the first question which comes to mind is ... "What is Serialization?" We know that we can create resusable objects in Java. But the...
1
11044
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7161
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7539
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7101
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.