473,387 Members | 1,702 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,387 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 2465
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.