Question about serialization w/ class inheritence.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Hasani

    Question about serialization w/ class inheritence.

    If I have a base class that is derived from many classes, and I want to make
    all the classes serializable. Is there a way I can do this from the base
    class or must I add [Serializable()] to every class, even if it's parent
    class has the [Serializable()] attribute.
    I'm thinking no from what I've seen on google so far.


  • Jay B. Harlow [MVP - Outlook]

    #2
    Re: Question about serialization w/ class inheritence.

    Hasani,
    As you are finding each serializable class needs the Serializable attribute,
    even when derived from classes that already have the Serializable attribute.

    In case you don't have them the following MSDN Magazine articles are useful
    for understanding Serialization.

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.

    Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


    Binary serialization is going to use less space then SOAP Serialization.
    SOAP serialization is really intended for Web Services (SOAP). There is also
    XML serialization which is not tied directly to SOAP Serialization, however
    you get a similar result.

    Hope this helps
    Jay


    "Hasani" <bitchacct@hax0 r.dyndns.org> wrote in message
    news:%23MGdZ0$o DHA.708@TK2MSFT NGP10.phx.gbl.. .[color=blue]
    > If I have a base class that is derived from many classes, and I want to[/color]
    make[color=blue]
    > all the classes serializable. Is there a way I can do this from the base
    > class or must I add [Serializable()] to every class, even if it's parent
    > class has the [Serializable()] attribute.
    > I'm thinking no from what I've seen on google so far.
    >
    >[/color]


    Comment

    • Hasani

      #3
      Re: Question about serialization w/ class inheritence.

      Good Find
      Thx
      "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in message
      news:uOxT19ApDH A.3732@tk2msftn gp13.phx.gbl...[color=blue]
      > Hasani,
      > As you are finding each serializable class needs the Serializable[/color]
      attribute,[color=blue]
      > even when derived from classes that already have the Serializable[/color]
      attribute.[color=blue]
      >
      > In case you don't have them the following MSDN Magazine articles are[/color]
      useful[color=blue]
      > for understanding Serialization.
      >
      > http://msdn.microsoft.com/msdnmag/issues/02/04/net/
      > http://msdn.microsoft.com/msdnmag/issues/02/07/net/
      > http://msdn.microsoft.com/msdnmag/issues/02/09/net/
      >
      > Binary serialization is going to use less space then SOAP Serialization.
      > SOAP serialization is really intended for Web Services (SOAP). There is[/color]
      also[color=blue]
      > XML serialization which is not tied directly to SOAP Serialization,[/color]
      however[color=blue]
      > you get a similar result.
      >
      > Hope this helps
      > Jay
      >
      >
      > "Hasani" <bitchacct@hax0 r.dyndns.org> wrote in message
      > news:%23MGdZ0$o DHA.708@TK2MSFT NGP10.phx.gbl.. .[color=green]
      > > If I have a base class that is derived from many classes, and I want to[/color]
      > make[color=green]
      > > all the classes serializable. Is there a way I can do this from the base
      > > class or must I add [Serializable()] to every class, even if it's parent
      > > class has the [Serializable()] attribute.
      > > I'm thinking no from what I've seen on google so far.
      > >
      > >[/color]
      >
      >[/color]


      Comment

      Working...