Generics and serialization

Discussion in 'Java' started by Roedy Green, Jan 16, 2008.

  1. Roedy Green

    Roedy Green Guest

    Roedy Green, Jan 16, 2008
    #1
    1. Advertising

  2. Roedy Green schreef:
    > I think I have finally got in clear why generics and serialisation
    > don't play well together, and what you can do about it, and what Sun
    > could do about it.
    >
    > I wrote a little essay with an example at
    > http://mindprod.com/jgloss/serialization.html#GENERICSSERIALIAZATION


    I do not agree with your solution.
    - Why go through the linear copying? Total waste of time.
    - This is exactly what @SuppressWarnings was introduced for. (With
    "unchecked"). I see not problem in using that annotation. It just
    ensures you think twice before doing something fishy with generics.
    This is a case where no clean way is possible, so the warning cannot be
    circumvented.

    You have a point that erasure is problematic, though.

    H.
    --
    Hendrik Maryns
    http://tcl.sfs.uni-tuebingen.de/~hendrik/
    ==================
    http://aouw.org
    Ask smart questions, get good answers:
    http://www.catb.org/~esr/faqs/smart-questions.html


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.4-svn0 (GNU/Linux)
    Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

    iD8DBQFHlHu7e+7xMGD3itQRAjtcAJ0XdjL58iht0ciCnJsOHsAHo3RLewCfUDBI
    9uHmL2PTDggrKMcVJ2AzEcE=
    =zEux
    -----END PGP SIGNATURE-----
    Hendrik Maryns, Jan 21, 2008
    #2
    1. Advertising

  3. Roedy Green

    Roedy Green Guest

    On Mon, 21 Jan 2008 12:02:18 +0100, Hendrik Maryns
    <> wrote, quoted or indirectly quoted someone
    who said :

    >> http://mindprod.com/jgloss/serialization.html#GENERICSSERIALIAZATION

    >
    >I do not agree with your solution.
    >- Why go through the linear copying?


    I gave three solutions. I have made the tradeoffs of each a little
    clearer in the most recent revision.
    --
    Roedy Green, Canadian Mind Products
    The Java Glossary, http://mindprod.com
    Roedy Green, Jan 21, 2008
    #3
  4. Roedy Green schreef:
    > On Mon, 21 Jan 2008 12:02:18 +0100, Hendrik Maryns
    > <> wrote, quoted or indirectly quoted someone
    > who said :
    >
    >>> http://mindprod.com/jgloss/serialization.html#GENERICSSERIALIAZATION


    Did you notice the typo: ^ ?

    >> I do not agree with your solution.
    >> - Why go through the linear copying?

    >
    > I gave three solutions. I have made the tradeoffs of each a little
    > clearer in the most recent revision.


    Looks much better now indeed. Thanks for your site again.

    H.
    --
    Hendrik Maryns
    http://tcl.sfs.uni-tuebingen.de/~hendrik/
    ==================
    http://aouw.org
    Ask smart questions, get good answers:
    http://www.catb.org/~esr/faqs/smart-questions.html


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.4-svn0 (GNU/Linux)
    Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

    iD4DBQFHlgkSe+7xMGD3itQRAhShAJYvBTnkZ/YulRf8N2cE92jbLIcBAJ4mG8ot
    ttuDvEXMyEWNkU262QZDBg==
    =KDZa
    -----END PGP SIGNATURE-----
    Hendrik Maryns, Jan 22, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    2,225
    deadsea
    Jan 2, 2005
  2. Juergen Berchtel
    Replies:
    1
    Views:
    5,967
    John C. Bollinger
    May 20, 2005
  3. Replies:
    3
    Views:
    1,009
  4. Dimitri Ognibene
    Replies:
    4
    Views:
    764
    Dimitri Ognibene
    Sep 2, 2006
  5. Ramunas Urbonas
    Replies:
    1
    Views:
    380
    Dino Chiesa [Microsoft]
    Jul 27, 2004
Loading...

Share This Page