473,406 Members | 2,713 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,406 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 2469
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: 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?
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
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...
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.