.NETGURU
Serialization vs Save
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngxml' list.


Pedersen, Ryan
-- Moved from [aspngfreeforall] to [aspngxml] by Michiel van Otegem <Click here to reveal e-mail address> --

I have extended the XmlDocument class to create a class whose data is stored
as semi-complex XML but have very specific methods to access the data
instead of the general methods that are supplied by XmlDocument.

I want to be able to serialize the class but I am not sure if is better to
use the Save method of the XmlDocument class or make my new class
serializable.

Can someone help?

Ryan Pedersen
Bank of America

Reply to this message...
 
    
Dan Wahlin
Since it sounds like your class extends XmlDocument by simply adding new
methods, Save() should still do the job since methods in the class
aren't serialized anyway. The base class should still handle the
internal representation of the XML that will be serialized. Are you
getting the expected result when calling Save() on your class? If it
works then there's not much sense in re-inventing the wheel. :)

Dan Wahlin

Wahlin Consulting LLC
Microsoft MVP - ASP.NET
http://www.XMLforASP.Net: #1 ASP.NET XML Resource
XML for ASP.NET Developers by Dan Wahlin in bookstores everywhere!

-----Original Message-----
From: Pedersen, Ryan [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 12:44 PM
To: aspngxml
Subject: [aspngxml] Serialization vs Save

-- Moved from [aspngfreeforall] to [aspngxml] by Michiel van Otegem
<Click here to reveal e-mail address> --

I have extended the XmlDocument class to create a class whose data is
stored
as semi-complex XML but have very specific methods to access the data
instead of the general methods that are supplied by XmlDocument.

I want to be able to serialize the class but I am not sure if is better
to
use the Save method of the XmlDocument class or make my new class
serializable.

Can someone help?

Ryan Pedersen
Bank of America
| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Pedersen, Ryan
Dan,

Thanks for the quick reply.

I want to add the object to ViewState so that it can be persisted on the
client's web page instead of session.

In order to add it to ViewState with the save command I have to do some
extra work with a XMLTextWriter and was hoping that [Serializable] would be
a short cut.

Any thoughts that you have on this would be greatly appreciated.

Ryan

-----Original Message-----
From: Dan Wahlin [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 4:20 PM
To: aspngxml
Subject: [aspngxml] RE: Serialization vs Save

Since it sounds like your class extends XmlDocument by simply adding new
methods, Save() should still do the job since methods in the class
aren't serialized anyway. The base class should still handle the
internal representation of the XML that will be serialized. Are you
getting the expected result when calling Save() on your class? If it
works then there's not much sense in re-inventing the wheel. :)

Dan Wahlin

Wahlin Consulting LLC
Microsoft MVP - ASP.NET
http://www.XMLforASP.Net: #1 ASP.NET XML Resource
XML for ASP.NET Developers by Dan Wahlin in bookstores everywhere!

-----Original Message-----
From: Pedersen, Ryan [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 12:44 PM
To: aspngxml
Subject: [aspngxml] Serialization vs Save

-- Moved from [aspngfreeforall] to [aspngxml] by Michiel van Otegem
<Click here to reveal e-mail address> --

I have extended the XmlDocument class to create a class whose data is
stored
as semi-complex XML but have very specific methods to access the data
instead of the general methods that are supplied by XmlDocument.

I want to be able to serialize the class but I am not sure if is better
to
use the Save method of the XmlDocument class or make my new class
serializable.

Can someone help?

Ryan Pedersen
Bank of America
| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
    
Dan Wahlin
What type of extra work are you doing? Formatting...or something else
like setting encoding?

Dan

Wahlin Consulting LLC
Microsoft MVP - ASP.NET
http://www.XMLforASP.Net: #1 ASP.NET XML Resource
XML for ASP.NET Developers by Dan Wahlin in bookstores everywhere!

-----Original Message-----
From: Pedersen, Ryan [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 1:27 PM
To: aspngxml
Subject: [aspngxml] RE: Serialization vs Save

Dan,

Thanks for the quick reply.

I want to add the object to ViewState so that it can be persisted on the
client's web page instead of session.

In order to add it to ViewState with the save command I have to do some
extra work with a XMLTextWriter and was hoping that [Serializable] would
be
a short cut.

Any thoughts that you have on this would be greatly appreciated.

Ryan

-----Original Message-----
From: Dan Wahlin [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 4:20 PM
To: aspngxml
Subject: [aspngxml] RE: Serialization vs Save

Since it sounds like your class extends XmlDocument by simply adding new
methods, Save() should still do the job since methods in the class
aren't serialized anyway. The base class should still handle the
internal representation of the XML that will be serialized. Are you
getting the expected result when calling Save() on your class? If it
works then there's not much sense in re-inventing the wheel. :)

Dan Wahlin

Wahlin Consulting LLC
Microsoft MVP - ASP.NET
http://www.XMLforASP.Net: #1 ASP.NET XML Resource
XML for ASP.NET Developers by Dan Wahlin in bookstores everywhere!

-----Original Message-----
From: Pedersen, Ryan [mailto:Click here to reveal e-mail address]
Sent: Tuesday, July 09, 2002 12:44 PM
To: aspngxml
Subject: [aspngxml] Serialization vs Save

-- Moved from [aspngfreeforall] to [aspngxml] by Michiel van Otegem
<Click here to reveal e-mail address> --

I have extended the XmlDocument class to create a class whose data is
stored
as semi-complex XML but have very specific methods to access the data
instead of the general methods that are supplied by XmlDocument.

I want to be able to serialize the class but I am not sure if is better
to
use the Save method of the XmlDocument class or make my new class
serializable.

Can someone help?

Ryan Pedersen
Bank of America
| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

| [aspngxml] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngxml.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

Reply to this message...
 
 
System.Xml.Formatting
System.Xml.XmlDocument




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification