Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Meaning of Serializable

Meaning of Serializable

Scheduled Pinned Locked Moved C#
questionsales
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pankaj Joshi
    wrote on last edited by
    #1

    I saw many examples over the net like [Serializable] public class Customer { } What is the meaning of the Serializable...? What it will do..?:confused:

    Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

    J 2 Replies Last reply
    0
    • P Pankaj Joshi

      I saw many examples over the net like [Serializable] public class Customer { } What is the meaning of the Serializable...? What it will do..?:confused:

      Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

      J Offline
      J Offline
      JoeRip
      wrote on last edited by
      #2

      Since nobody is around to give you a better explanation, I'll give you a real light view: It basically means that the object/data can be persisted beyond the lifetime of your application - that is, saved. Written down somewhere. Like on disk. The real meaning is actually more abstract than that, but this is a pretty good start. Do some searching in Google or in the MS SDK documentation, you'll see a lot more on it.

      1 Reply Last reply
      0
      • P Pankaj Joshi

        I saw many examples over the net like [Serializable] public class Customer { } What is the meaning of the Serializable...? What it will do..?:confused:

        Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

        J Offline
        J Offline
        JoeRip
        wrote on last edited by
        #3

        Here's a page in the SDK documentation about it. http://msdn2.microsoft.com/en-us/library/72hyey7b(VS.71).aspx[^]

        P 1 Reply Last reply
        0
        • J JoeRip

          Here's a page in the SDK documentation about it. http://msdn2.microsoft.com/en-us/library/72hyey7b(VS.71).aspx[^]

          P Offline
          P Offline
          Pankaj Joshi
          wrote on last edited by
          #4

          JoeRip, Thanks for your reply. But I can't get the line "It basically means that the object/data can be persisted beyond the lifetime of your application - that is, saved. Written down somewhere. Like on disk." If My application is closed then how would I know the object is persist or not...? If persist then what is the name of it and how can I access it...? And when I set objCustomer=null then it automatically destroyed and if I can't do this the GC will automatically clear it from memory.... Please reply....

          Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

          modified on Saturday, December 15, 2007 3:33:31 AM

          D J 2 Replies Last reply
          0
          • P Pankaj Joshi

            JoeRip, Thanks for your reply. But I can't get the line "It basically means that the object/data can be persisted beyond the lifetime of your application - that is, saved. Written down somewhere. Like on disk." If My application is closed then how would I know the object is persist or not...? If persist then what is the name of it and how can I access it...? And when I set objCustomer=null then it automatically destroyed and if I can't do this the GC will automatically clear it from memory.... Please reply....

            Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

            modified on Saturday, December 15, 2007 3:33:31 AM

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            You have to write the code to serialize the object to a file on disk, or some other data store. It doesn't happen automatically.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007

            1 Reply Last reply
            0
            • P Pankaj Joshi

              JoeRip, Thanks for your reply. But I can't get the line "It basically means that the object/data can be persisted beyond the lifetime of your application - that is, saved. Written down somewhere. Like on disk." If My application is closed then how would I know the object is persist or not...? If persist then what is the name of it and how can I access it...? And when I set objCustomer=null then it automatically destroyed and if I can't do this the GC will automatically clear it from memory.... Please reply....

              Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

              modified on Saturday, December 15, 2007 3:33:31 AM

              J Offline
              J Offline
              JoeRip
              wrote on last edited by
              #6

              You didn't ask how to do it, you asked what it meant. If you follow the link I sent you, it's all explained. Some of the existing .NET / CLR classes are already serializable, meaning the work has been done to allow you to serialize them. For your own objects, there is plenty of information in MSDN on how to write specific serialization code. Start at the link I gave you.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups