On 2011-08-23 16:38, Andrei Alexandrescu wrote:
On 8/23/11 12:55 AM, Jacob Carlborg wrote:
On 2011-08-23 08:52, Andrei Alexandrescu wrote:
On 8/22/11 11:30 PM, Jacob Carlborg wrote:
Ok, then I just change "register" to a static method.
A static method of whom?
Andrei
Well, "register" currently an instance method of Serializer so I would
change it to be a static method of Serializer.
I think the ability of a class to be serialized would be independent of
the notion of a serializer. To me, "this class is serializable" really
means "this class has metadata associated with it that allows interested
parties to serialize it". But perhaps this is splitting hairs.
Andrei
You don't want to have it in the class and don't want it in the
serializer. I mean, it needs to be stored somewhere and I thought that a
static method in Serializer would better than a completely global function.
Are you thinking about having another serialization library that can use
this information as well? I'm not sure if that's good idea, different
serialization implementations might need to do very different things
with the information.
--
/Jacob Carlborg