Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Generics and serialization

Reply
Thread Tools

Generics and serialization

 
 
Roedy Green
Guest
Posts: n/a
 
      01-16-2008
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/serializa...SERIALIAZATION
--
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com
 
Reply With Quote
 
 
 
 
Hendrik Maryns
Guest
Posts: n/a
 
      01-21-2008
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/serializa...SERIALIAZATION


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+7xMGD3itQRAjtcAJ0XdjL58iht0ciCnJsOHs AHo3RLewCfUDBI
9uHmL2PTDggrKMcVJ2AzEcE=
=zEux
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      01-21-2008
On Mon, 21 Jan 2008 12:02:18 +0100, Hendrik Maryns
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone
who said :

>> http://mindprod.com/jgloss/serializa...SERIALIAZATION

>
>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
 
Reply With Quote
 
Hendrik Maryns
Guest
Posts: n/a
 
      01-22-2008
Roedy Green schreef:
> On Mon, 21 Jan 2008 12:02:18 +0100, Hendrik Maryns
> <(E-Mail Removed)> wrote, quoted or indirectly quoted someone
> who said :
>
>>> http://mindprod.com/jgloss/serializa...SERIALIAZATION


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-----

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to move from java object serialization to xml serialization? Dimitri Ognibene Java 4 09-02-2006 07:32 AM
Object serialization XML vs java serialization plasticfloor@gmail.com Java 3 06-14-2006 03:45 AM
Can't convert a generics list of objects into a generics list ofinterfaces Juergen Berchtel Java 1 05-20-2005 02:07 PM
Serialization Problems and books on serialization? sinleeh@hotmail.com Java 8 01-02-2005 02:40 PM
avoiding XML serialization, different WSDL generation, soap serialization Ramunas Urbonas ASP .Net Web Services 1 07-27-2004 09:57 PM



Advertisments