#1 2012-10-31 22:55:54

VojkoCendak
Member
From: Celje Slovenia
Registered: 2012-09-02
Posts: 88

Possibilty to just add to RegisterCustomSerializer?

Hi,

I don't quite understand this RegisterCustomSerializer yet.
It seems that it completely overrides the original serializer.
Is this true?

It would be VERY nice to implement possibility to add/remove
some selected properties.

thank you,
Vojko

Offline

#2 2012-11-01 10:22:32

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,238
Website

Re: Possibilty to just add to RegisterCustomSerializer?

Yes, RegisterCustomSerializer process is global for the class.

It allows custom serialization of an object not only into a JSON list of properties, but another layout, like a JSON array or a JSON string.

I do not understand what you want exactly about "add/remove some selected properties", since it is already the case: you can use "stored false" statement, or not publish a property.

Offline

#3 2012-11-01 13:37:22

VojkoCendak
Member
From: Celje Slovenia
Registered: 2012-09-02
Posts: 88

Re: Possibilty to just add to RegisterCustomSerializer?

Thank you for reply.

Ok I see.

How can we make something like this:

class procedure TCustomTagsSer.FVClassWriter(...)
....
// write a complete object ?
aSerializer.WriteObject(V);  // this doesn't work because of callback. any idea how to hack this ?
// and then or between .... ?
// unpublished properties ...
aSerializer.AddCustomProperties(['PropName1', myvalue1, ....]);
....

class procedure TCustomTagsSer.FVClassReader(...)
....
// write a complete object ?
DecodeObject(V);
// and then or between .... ?
// unpublished properties ...
DecodeCustomProperties(['PropName1', myvalue1, ....]);
....

The thing is we have a lot of different ancestors.

We could implelement one dummy published string property and assign it in the service when we poll the service (not in the streamer),
and then decode it on the client, but it's ugly ...

Any ideas appretiated.

thank you,
Vojko

Last edited by VojkoCendak (2012-11-01 14:13:49)

Offline

Board footer

Powered by FluxBB