On 2011-09-06 18:15, Marco Leise wrote:
Ok I get the picture, but the details are vague.
- How are pointers printed? As a hex value or as the data they point to
(flat toString vs. deep toString). A serialization API typically follows
class references and pointers.
If the pointer points to a value that have been or later will be
serialized as well it will just print it as a reference. If the pointed
value is not serialized it will print the pointed data.
- What do you do with classes that in Java don't inherit the
Serializable interface. Thread.toString() for example should - in my
eyes - print the thread id or pointer and the thread name if available,
maybe also the thread group.
In my Orange "Serializable" isn't needed. It will try to serialize
everything unless otherwise told, i.e. there's a NonSerialized mixin.
But for Thread.toString() you would most likely not use the
serialization library.
And that's why I keep repeating that toString() is different from
serialization. It can _assist_ if you know you just want to print all
members of a struct in their default representation (which is what you
often want), but not replace it. Maybe that is what Sean meant to say,
but I wanted to clarify that.
I think that's what Sean is trying to say.
--
/Jacob Carlborg