#1 2012-09-17 22:38:08

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

Saving defined properties

Hi, (Delphi2009 ent)

I noticed that DefineProperties are not stored by default in the streamer?
Was this intended?
We wanted to use in TComponent save/restore.

thank you,
Vojko

Offline

#2 2012-09-18 05:42:35

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

Re: Saving defined properties

Yes, since it will save the content as plain binary, it is not very JSON friendly.

You would rather use custom JSON serialization, as stated in http://blog.synopse.info/post/2012/04/1 … -any-class

You may write your custom serializer which will call DefineProperties and save the content as a JSON base64 content.

Online

#3 2012-10-30 12:50:45

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

Re: Saving defined properties

Maybe just a global setting or when HumanReadable=False ?.
Defined IS part of Delphi's component structure.
IMHO it's better to get accurate object snapshot.

Offline

#4 2012-11-01 10:12:10

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

Re: Saving defined properties

Good idea.

I'll add it to the roadmap.
I think it should be enabled by default, for any TComponent which supports it.

Online

#5 2013-05-31 08:18:27

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

Re: Saving defined properties

Hi,

is there any way to implement this ?
This would be major enhancement in streaming existing components.

I'll create ticket for it -> http://synopse.info/fossil/tktview/3369 … fb5c6f49a1


thank you, Vojko

Last edited by VojkoCendak (2013-05-31 08:20:24)

Offline

#6 2013-05-31 08:50:33

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

Re: Saving defined properties

For ORM level, I suspect a BLOB storage could be a good idea, serialized as JSON using Base64 encoding?

What is your exact need?
Streaming components into/from JSON?
Storing TPersistent properties of a TSQLRecord ORM table?

Online

#7 2013-05-31 11:11:00

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

Re: Saving defined properties

Streaming components into/from JSON? -> Yes
Storing TPersistent properties of a TSQLRecord ORM table? -> Yes

Yes it can be BLOB storage.


thank you, vojko

Last edited by VojkoCendak (2013-05-31 11:13:16)

Offline

#8 2013-05-31 15:14:17

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

Re: Saving defined properties

we need badly streaming of fullblown variants:
check http://synopse.info/forum/viewtopic.php?pid=7817#p7817

Offline

Board footer

Powered by FluxBB