Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > serialize spoilers

Reply
Thread Tools

serialize spoilers

 
 
bob smith
Guest
Posts: n/a
 
      10-24-2012
What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-25-2012
On Wed, 24 Oct 2012 14:05:00 -0700 (PDT), bob smith
<(E-Mail Removed)> wrote, quoted or indirectly quoted someone
who said :

>What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?

If it is a built-in class, there is probably a good reason it is not
Serializable. For example Images contain platform specific
information, so you cannot save Images on one platform and
reconstitute them on another.

You can mark references transient, and restore them on your own
somehow.

You can look for some third party solution, or save them in some other
format, e.g. images as PNG files.

--
Roedy Green Canadian Mind Products http://mindprod.com
There are four possible ways to poke a card into a slot.
Nearly always, only one way works. To me that betrays a
Fascist mentality, demanding customers conform to some
arbitrary rule, and hassling them to discover the magic
orientation. The polite way to do it is to design the reader
slot so that all four ways work, or so that all the customer
has to do is put the card in the vicinity of the reader.


 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      10-25-2012
On 10/24/2012 5:05 PM, bob smith wrote:
> What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?


I think you could use Ted Neward's Serializable Adapter approach.

Unfortunately I can not find a working link to that anymore.

Arne


 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      10-25-2012
bob smith wrote:
> What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?


Nothing without first reading the section of /Effective Java/ by Joshua Bloch that tells you how
to deal with serialization.
http://my.safaribooksonline.com/book.../9780137150021
http://books.google.com/books?id=Ft8...bs_toc_r&cad=4

You need to buy the book to get every page, but that's all right because you need to buy the book.

Suffice to say that there are mechanisms to deal with your situation, but you aren't going to learn
the fundamentals of serialization by asking random questions on Usenet.

--
Lew
 
Reply With Quote
 
Sebastian
Guest
Posts: n/a
 
      10-27-2012
Am 24.10.2012 23:05, schrieb bob smith:
> What do you typically do when you want to serialize an object that doesn't naturally implement Serializable?


There is an approach by Olivier Croisier you might be able to use.
Here's a link (the page is in French):

http://thecodersbreakfast.net/index....izable-objects

-- Sebastian


 
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
serialize to SQL Server Blob instead of XML serialize Gordz ASP .Net 3 06-07-2004 07:46 PM
Spoilers in Menu's on 24 Second Season Rutgar DVD Video 4 02-17-2004 04:09 AM
"Matrix Revolutions" (minimal spoilers) Peter Briggs DVD Video 3 11-06-2003 09:14 AM
HULK DVD (Spoilers) Treetop DVD Video 0 10-30-2003 09:23 PM
Re: MATRIX RELOADED (spoilers..) Darth This DVD Video 0 06-24-2003 09:17 AM



Advertisments