liubiao4123 / servicestack

Automatically exported from code.google.com/p/servicestack
0 stars 0 forks source link

Add type information to JSV #38

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
This is more a feature request. I would like to use JSV like now, but I would 
also want JSV to be able to serialize/deserialize the types of the stored 
objects.

I know how to do that by myself with a simple object, but when you have several 
nested objects, it starts to be complicated.

Maybe as an option? So, people can use both for POCO or for full class 
serialization/deserialization.

Original issue reported on code.google.com by mvolmaro@gmail.com on 23 Sep 2010 at 4:07

GoogleCodeExporter commented 8 years ago
Hi Sorry, I think I missed reading this feature request.

I don't actually know what you mean by:

"I would also want JSV to be able to serialize/deserialize the types of the 
stored objects"?

Original comment by demis.be...@gmail.com on 5 Oct 2010 at 4:45

GoogleCodeExporter commented 8 years ago
Basically, that means that I can have a property defined as "object", but its 
real type is, for example, a class.

Right now, the object (class) is serialized properly, but it is impossible to 
deserialize it back since its type information can not be inferred from the 
original object (as its base class is "object").

I know how to handle this with one or two properties, but when you do not have 
access to the source of the object you want to serialize (my case) it is simply 
impossible to deserialize a serialized object.

You call them "Late-bound objects" and have a blog entry about them...

Original comment by mvolmaro@gmail.com on 5 Oct 2010 at 5:28

GoogleCodeExporter commented 8 years ago
Oh yeah in that case, Unfortunately I don't expect to do any more changes on 
that front. The way its currently implemented is optimized for size and speed. 
If you need to auto-support late-bound objects you're going to have to come up 
with a similar solution as outlined in my post, sorry. 

Original comment by demis.be...@gmail.com on 5 Oct 2010 at 5:51