Results 1 to 4 of 4

Thread: A quick Serialization question

  1. #1

    Thread Starter
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    A quick Serialization question

    I want to write a class that holds lots of info about buildings. It'll hold all the normal stuff like address (that one's kinda important) and date of construction etc. But I'd like to have a small thumbnail image of the building too.

    If I use serialization to save this to a binary file, will the image be saved too? Or just the other data?

    Thanks.

    AW.
    I don't live here any more.

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Yes you can serialize images in a class no problem.

  3. #3
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    Serialization has the *BIG* problem that if you later want to update your class and load the saved serialized files that will throw an exception.
    \m/\m/

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Yes it stores versioning info but this shouldn't be a problem. If you want to update your call you just inherit from the old one and make a new version in a new class. It can still be a bit of a pain but you can then manage the deserialization and adjust the return type for which ever version is needed.
    Last edited by Edneeis; Apr 4th, 2004 at 04:17 PM.

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