473,320 Members | 1,856 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,320 software developers and data experts.

Serialization

Experienced members,

I need some advice, or maybe I am missing something
simple.

I have 2 classes.

public class Manager

public property Controls as arraylist

public function CreateObject(byval type as Types) as
IObject

end class

public class myControl
implement IObject
public property Controls as arraylist
public property Parent as IObject
end class

I have a circular reference when I do this;

dim man as new manager
dim c1 as new myControl
dim c2 as new myControl

c1.controls.add(c2)
c2.Parent = c1
man.controls.add(c1)

Ok, now I have a object tree. I would like to serialize
the manager object in a human readable format. I have
used the soapformmater (ugly xml and don't need in soap
fromat) as well as the binaryformatter (works, but not
human readable).

My question is.... Is there a way to serialize this in
much the same way that the xmlserializer would? Or, is
there a design pattern different to hold a reference to
child and parent?

I would be very greatful for any direction on this.

Thanks in advance,

Chris Smith
Nov 12 '05 #1
2 2458
Chris,

you can instruct the XmlSerializer to produce Soap 1.1 section 5 compliant
XML much like the SoapFormatter does. This should be sufficient if you're
just after a human readable, XML based format. Take a look at the thread of
[0] for more details on how to get section 5 formatted XML out of the
XmlSerializer.

--
HTH
Christoph Schittko [MVP, XmlInsider]
Software Architect, .NET Mentor

[0]
http://groups.google.com/groups?hl=e...TNGP11.phx.gbl

"Chris Smith" <us**@email.com> wrote in message
news:#N**************@TK2MSFTNGP09.phx.gbl...
Experienced members,

I need some advice, or maybe I am missing something
simple.

I have 2 classes.

public class Manager

public property Controls as arraylist

public function CreateObject(byval type as Types) as
IObject

end class

public class myControl
implement IObject
public property Controls as arraylist
public property Parent as IObject
end class

I have a circular reference when I do this;

dim man as new manager
dim c1 as new myControl
dim c2 as new myControl

c1.controls.add(c2)
c2.Parent = c1
man.controls.add(c1)

Ok, now I have a object tree. I would like to serialize
the manager object in a human readable format. I have
used the soapformmater (ugly xml and don't need in soap
fromat) as well as the binaryformatter (works, but not
human readable).

My question is.... Is there a way to serialize this in
much the same way that the xmlserializer would? Or, is
there a design pattern different to hold a reference to
child and parent?

I would be very greatful for any direction on this.

Thanks in advance,

Chris Smith

Nov 12 '05 #2
Chris,

In addition to the other advice provided by Cristoph Schittko, I may also suggest you that instead of trying to "clear up" the "ugly" XML resulted through XML SOAP formatting, you can try to write a XSLT translator which translates the "ugly" XML to a simpler and more readable XML format or to HTML.

XSLT is very powerful and provides support for X/Path query expressions which could get your job done very quickly, I suppose.

--
Sorin Dolha [MCP, MCAD]
"Chris Smith" <us**@email.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl...
Experienced members,

I need some advice, or maybe I am missing something
simple.

I have 2 classes.

public class Manager

public property Controls as arraylist

public function CreateObject(byval type as Types) as
IObject

end class

public class myControl
implement IObject
public property Controls as arraylist
public property Parent as IObject
end class

I have a circular reference when I do this;

dim man as new manager
dim c1 as new myControl
dim c2 as new myControl

c1.controls.add(c2)
c2.Parent = c1
man.controls.add(c1)

Ok, now I have a object tree. I would like to serialize
the manager object in a human readable format. I have
used the soapformmater (ugly xml and don't need in soap
fromat) as well as the binaryformatter (works, but not
human readable).

My question is.... Is there a way to serialize this in
much the same way that the xmlserializer would? Or, is
there a design pattern different to hold a reference to
child and parent?

I would be very greatful for any direction on this.

Thanks in advance,

Chris Smith
Nov 12 '05 #3

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

Similar topics

3
by: Aaron Clamage | last post by:
Hi, I'm not sure that if this is the right forum, but any help would be greatly appreciated. I am porting some java serialization code to c# and I can't figure out the correct way to do it. ...
4
by: mijalko | last post by:
Hi, I have inherited my class from System.Drawing.Printing.PrintDocument and I wish to serialize this object using XmlSerializer. And I get exception "There was an error reflecting type ...". If I...
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
1
by: kikisan | last post by:
I am developing a windows service which utilizes the following classes: interface IPersistable; abstract class PersistableObject : IPersistable;
2
by: mkvenkit.vc | last post by:
Hello, I hope this is the right place to post a question on Boost. If not, please let me know where I can post this message and I will do so. I am having a strange problem with std::string as...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.