Thanks, Dan!

That definitely makes sense.

What I like about object callbacks is the code readability. Compare:

Method %OnBeforeSave(insert as %Boolean) As %Status [ Private, ServerOnly = 1 ]

{

if insert s ..CreationDate=$H

q $$$OK }

And 

Property CreationDate As %TimeStamp [ SqlComputeCode = { set {*}=$zdt($h,3) }, SqlComputed, SqlComputeOnChange = %%INSERT ];

What if I would need to refer to other properties in

{*)=expression() 

Or the expression would be complex and if I want to debug it?

Is there a way to keep callbacks readability and have the callback methods  be fired for object and SQL access both?

Something like:

Property CreationDate As %TimeStamp [ SqlComputeCode = { set {*}=..%OnBeforeSave(1) }, SqlComputed, SqlComputeOnChange = %%INSERT ];

Hi, Vineeth!

See the sample of exporting and importing global to zip file on the fly from @Eduard Lebedyuk post:

set ^dbg=123
set s=##class(%Stream.FileBinaryGzip).%New()
do s.LinkToFile("1.xml")
do $System.OBJ.ExportToStream("dbg*.GBL", s)
do s.%Save()
kill
kill ^dbg
set s=##class(%Stream.FileBinaryGzip).%New()
do s.LinkToFile("1.xml")
do $System.OBJ.LoadStream(s)
write ^dbg
>123

Hope that helps.

If you have customised the storage schema

But how can I customize it? Do you mean manually?

When I export the class def to the file I have the regenerated schema every time. So the only way to customize it is to change the schema manually in exported file. And this would be the risk to experience problems after importing that class.

To be clear, I do keep schema with the class def in Git and I never ever changed (hope so) this part of the class definition. It is useful for me only for information purposes to know where  the data is stored.

 So here is my question: why should I export and keep this part of class def if I don't want to know where is the data and don't want to have risk to manually change the storage data?

This can have serious consequences as data may get stored in a different place from data stored by previous versions of the class.

I believe if you change properties and indexes of the persistent class it would definitely cause  serious consequences on the data of previous versions of the class (but happily here we have the recipe of data conversion and etc).