dartwatch-JsonObject icon indicating copy to clipboard operation
dartwatch-JsonObject copied to clipboard

Type information

Open generateui opened this issue 13 years ago • 2 comments

I was thinking about adding a property "__type" (iirc this is how other systems do it), to know what concrete type is just serialized. This is useful for when you expect to receive polymorhpic objects which you don't know where to instantiate from. Currently, there is no reflection, so I use object.toString() to retrieve the concrete type name, while not overriding toString() anywhere (I introduced toText(), this also has other advantages)

I have this "feature" already in my adoption of JsonObject. If there is any interest, I can provide a patch.

generateui avatar Jun 06 '12 13:06 generateui

Hi, Sorry for the delay getting back to you. Yes, this sounds interesting - could you provide a patch.
Thanks.

chrisbu avatar Jun 23 '12 10:06 chrisbu

FYI: I'm busy, I expect to do dart again within a few weeks. Haven't forgot it ;).

generateui avatar Jul 21 '12 10:07 generateui