Evgeny Shvarov · May 26, 2017 go to post

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 ];

Evgeny Shvarov · May 26, 2017 go to post

Thank you, Rubens, Fabian, Sean.

Agreed, that Initial expression is the best option here. And thanks for the explanations on the callbacks!

Evgeny Shvarov · May 26, 2017 go to post

Thanks, Sean!

JSON-RPC library

Would be great to look into this if you want to expose it some day.

Evgeny Shvarov · May 25, 2017 go to post

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.

Evgeny Shvarov · May 25, 2017 go to post

Yes, you are right and I agree. George, thank you very much for thorough explanations.

Evgeny Shvarov · May 25, 2017 go to post

So, it's never safe to go without storage schema (even with default storage schema) if you want to either to delete or add new class properties.

Evgeny Shvarov · May 24, 2017 go to post

So, in the end, if I want to store in VCS only class body (without storage schema)  it is safe to do it if:

I use only default storage schema in this project;

I never delete properties and use "deprecated" clause instead.

Right?

Evgeny Shvarov · May 24, 2017 go to post

Right. But I would never delete and change the name of the properties if you have the data behind them already. I prefer "deprecated" approach of "deleting" unused properties.

I think it is a good candidate for another question. 

Evgeny Shvarov · May 24, 2017 go to post

Yes, sure. If you customized the default storage (which is not very recommended, see @Kyle Baxter's answer) on purpose it becomes the part of the solution and should be stored in VCS along with class def. 

Evgeny Shvarov · May 24, 2017 go to post

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).

Evgeny Shvarov · May 24, 2017 go to post

Why not: if you import the class without schema it would be generated automatically according to the class description.  So why to export and keep it in VCS?

Evgeny Shvarov · May 22, 2017 go to post

Hi, Rubens!

Thanks for sharing this!

I like to see UDL code in sources and folder=package structure for the source code.

Few ideas:

Why not save code without txt extention? Cls would go with .cls, include files with .inc and etc, like in this project, or  this project or in that one.

Would you please share a small screencast video of the general use cases which shows the key advantages and benefits?

Thank you in advance!

Evgeny Shvarov · May 22, 2017 go to post

First with tools we already have here: drupal and solr.

We keep iFind and iKnow in mind, already did first approach to iKnow Analytics and I think it would be a nice option too.

Evgeny Shvarov · May 20, 2017 go to post

Hi, Ed! Thanks!

I was looking if we have something "out-of-the box" for DeepSee pivots and dashes testing. 

Yes, I think it would work for pivots. We have dashboards also. Any thoughts?

Evgeny Shvarov · May 20, 2017 go to post

Hi, Arockia!

InterSystems Caché is multi-model DBMS - see the official information. Caché comes with 3 models "out-of-the box": Globals, SQL, Caché Objects.

Everything in Caché is stored in Globals, which are multidimensional key-value indexed variables with persistent nature.  The good visible explanation of "what is global" you can find in this Merge command article, or in @Rob Tweed's article.

"Multi-model" means that:

- you can store data in the same database with different data models simultaneously.

- you can access the same data via different data engines if the data models are compatible: e.g.  you can operate with same data via Caché SQL, Caché Objects and Globals because they are compatible. Need to notice, that if you want to access globals, which are part of storage schema for Caché Objects and SQL it is safe to access only for read manipulations(or you should be very confident in what are you doing). For other types of manipulation better use documented model-related functions.

- you can use the data models which come "out-of-the box" (Globals, SQL, Caché Objects) and you can implement your own data-manipulation library with Caché ObjectScipt or bindable languages which would store the data in Globals in your own way, structure and logic. Using this approach you can implement literally any data model e.g. graph, document store, key-value, your-own-unique-extraordinary-database-model, but you would be responsible for the  support as well ;)

Hope that helps.