Results 1 to 10 of 10

Thread: [RESOLVED] xml and dataset/hashtable

  1. #1

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Resolved [RESOLVED] xml and dataset/hashtable

    i have about 20 key/value pairs that i want to store in an xml file (the key/value pairs store user preferences for my application). would it be best to use a hashtable or a dataset for this? or is there a better way for storing user preferences (without using the registry).
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: xml and dataset/hashtable

    A dataset, because a dataset has the write to xml method which makes life easier for you.

  3. #3

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: xml and dataset/hashtable

    thanks.

    im guessing that a dataset also has a read from xml method.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] xml and dataset/hashtable

    That is correct.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] xml and dataset/hashtable

    Not that it really matters for such a small amount of data, but the XML generated for a DataSet will be much more verbose than that for a serialised collection.

    Edit:
    I also like to create a custom class for my program settings. Each app's settings class is derived from a base class that has a Save method that takes a file path and saves the current instance, and a Shared Load method that takes a file path and deserialises the file to an instance of the class and returns it.
    Last edited by jmcilhinney; Jul 15th, 2005 at 02:14 AM.

  6. #6

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: [RESOLVED] xml and dataset/hashtable

    what is a serialised collection?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] xml and dataset/hashtable

    Serialisation is the process of converting an object to a form that can be transmitted in a serial manner. You serialise a .NET object to either a binary or text (XML) format for serial transmission, or storage. When you call WriteXml on a DataSet, you are serialising it. The DataSet class implements ISerializable, so it provides its own serialisation functionality. For classes that don't, you would use an XmlSerializer to serialise and deserialise instances. You can also use binary serialisation, but I've never had the pleasure. Binary serialisation is more efficient, I believe, but XML serialisation has the advantage of producing human-readable results.

  8. #8

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: [RESOLVED] xml and dataset/hashtable

    so i could create a hashtable and serialise it to store the data in an xml file?
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [RESOLVED] xml and dataset/hashtable


  10. #10

    Thread Starter
    Frenzied Member tr333's Avatar
    Join Date
    Nov 2004
    Location
    /dev/st0
    Posts
    1,605

    Re: [RESOLVED] xml and dataset/hashtable

    thanks...

    great link!


    EDIT: stupid forum wont let me give rep points until i spread them around.
    CSS layout comes in to the 21st century with flexbox!
    Just another Perl hacker,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width