473,396 Members | 1,918 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Serializing multiple but equal objects...

I've had great success with the XmlSerializer but ran into a new problem.
Say I have "classA" with a reference to "myObject" and "classB" with a
reference to "myObject" ... it appears that the one "myObject" gets
serialized as two separate objects. And consequently, when you deserialized
"classA" and "classB" the two "myObjects" are not equal.
How can I serialize a class so that any references to the same object, are
deserialized the same, referencing only one object?
Thanks,
Jacob
Nov 16 '05 #1
2 1197
Hello

Use soap formatter or binary formatter

Best regards
Sherif

"Jacob" <js@hotmail.com> wrote in message
news:qveTc.28682$Lj.22914@fed1read03...
I've had great success with the XmlSerializer but ran into a new problem.
Say I have "classA" with a reference to "myObject" and "classB" with a
reference to "myObject" ... it appears that the one "myObject" gets
serialized as two separate objects. And consequently, when you deserialized "classA" and "classB" the two "myObjects" are not equal.
How can I serialize a class so that any references to the same object, are
deserialized the same, referencing only one object?
Thanks,
Jacob

Nov 16 '05 #2
It works great! Thanks for the help.

Jacob

"Sherif ElMetainy" <el*************@wayout.net.NOSPAM> wrote in message
news:Ob**************@TK2MSFTNGP12.phx.gbl...
Hello

Use soap formatter or binary formatter

Best regards
Sherif

"Jacob" <js@hotmail.com> wrote in message
news:qveTc.28682$Lj.22914@fed1read03...
I've had great success with the XmlSerializer but ran into a new problem. Say I have "classA" with a reference to "myObject" and "classB" with a
reference to "myObject" ... it appears that the one "myObject" gets
serialized as two separate objects. And consequently, when you

deserialized
"classA" and "classB" the two "myObjects" are not equal.
How can I serialize a class so that any references to the same object, are deserialized the same, referencing only one object?
Thanks,
Jacob


Nov 16 '05 #3

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

Similar topics

4
by: John Vottero | last post by:
When a class contains a TimeSpan property, XmlSerializer doesn't work. A TimeSpan property is serialized like: <MySpan /> I've read a number of posts that talk about why this happens and how...
1
by: Ivo Bronsveld | last post by:
All, I have quite a challenging task ahead of me. I need to write an object model (for code access) based on a schema, which cannot be made into a dataset because of it's complexity. So I...
2
by: Tobias Zimmergren | last post by:
Hi, just wondering what serializing really is, and howto use it? Thanks. Tobias __________________________________________________________________ Tobias ICQ#: 55986339 Current ICQ status: +...
4
by: Dave Veeneman | last post by:
When does serializing objects make more sense than persisting them to a database? I'm new to object serialization, and I'm trying to get a feel for when to use it. Here is an example: I'm...
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
0
by: JackRazz | last post by:
I'm trying to serialize a collection to a file stream by serializing each object individually. The code below works fine with the BinaryFormatter, but the SoapFormatter reads the first object and...
3
by: axr | last post by:
Having trouble with Serilization of objects that contain members which are of type Interface eg public class SomeClass { ISomeInterface1 itf1; ClassType1 ct1; ISomeInterface2 itf2;
47
by: Max | last post by:
Due to the behaviour of a particular COM object, I need to ensure that a request for a particular ASP page is finalized before another request for the page is processed. Does IIS have a way to...
3
by: Thyme | last post by:
Each time I serialize an object using XmlSerializer I get a structure like this: <?xml version="1.0"?> <MyType> .. .. </MyType> <?xml version="1.0"?> <MyType> ..
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.