Posted by
ctrueden on
URL: http://imagej.273.s1.nabble.com/Serialization-trouble-shooting-tp5007683p5007708.html
Hi,
> Please study what Java serialization is, exactly. I fear that the way
> you are using is outside its intended usage. In particular, you will
> find that trying to serialize random objects whose classes define all
> kinds of fields intended for display will cause all kinds of problems
> that you will only understand if you know what serialization is about.
Perhaps the Externalizable interface would be a better fit here:
http://stackoverflow.com/q/817853Externalization gives you more complete control over the process. It is
initially more work but much more robust long term.
Regards,
Curtis
On Mon, May 12, 2014 at 3:39 PM, Johannes Schindelin <
[hidden email]> wrote:
> Hi Influenza,
>
> On Sun, 11 May 2014, Influenza wrote:
>
> > I'm currently working on a Plugin that simplifies evaluation of
> > microbiological images. Therefor I planned to develop a serializable
> object,
> > such that I can save and load my results in an easy way.
>
> Please study what Java serialization is, exactly. I fear that the way you
> are using is outside its intended usage. In particular, you will find that
> trying to serialize random objects whose classes define all kinds of
> fields intended for display will cause all kinds of problems that you will
> only understand if you know what serialization is about.
>
> There is a good reason, for example, why ROIs in ImageJ are saved in a
> custom format rather than using Java serialization.
>
> The same applies, most likely, to your data: you want to be specific about
> what to write to disk, and avoid using Java serialization (which backfired
> rather nicely in your case, too ;-)).
>
> Ciao,
> Johannes
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html