Re: Is using XmlSerializer the right choice?
- From: "hOSAM" <hosam.shahin##gmail.com>
- Date: Fri, 16 Sep 2005 05:15:13 +0300
Hi,
You can decide if you would use the XmlSerializer or not based on how you
want to design your classes; because XmlSerializer imposes certain
restrictions on your classes desings. Mainly, you must have a default
constructor and you must have getters and setters on all properties that you
want to serialize, if that is the way you are building your class, then use
the XmlSerializer, otherwise if you feel unhappy with these restrictions,
then you can go your own way.
<yinjennytam@xxxxxxxxxxxxxxxx> wrote in message
news:4E8CF731-F36F-4B61-B323-0DA8B3994476@xxxxxxxxxxxxxxxx
> Hi all
>
> I'm learning XML and .NET and I saw an example of using XmlSerializer to
> deserialize an XML file to get the corresponding object in memory. I
> found
> it very useful for my purpose. However, for simple properties it works
> for
> me, but I actually need a bit more than just properties.
>
> For example, my class actually contains a collection of strings as well,
> now
> is using XmlSerializer the right choice? I don't know how many there will
> be, but ideally I can just create a file (say an XML) and add as many
> strings
> as necessary such that they will be added to the collection of the object
> in
> memory.
>
> Any pointers or suggestions are greatly appreciated! Thanks!
>
.
- Prev by Date: Serialization & Deserialization
- Next by Date: Re: Serialization & Deserialization
- Previous by thread: Serialization & Deserialization
- Next by thread: RE: Is using XmlSerializer the right choice?
- Index(es):
Relevant Pages
|
Loading