Object Data Model

Syndicate content 10 

Class Queries in InterSystems Caché is a useful tool that separates SQL queries from Caché Object Script code. Basically, it works like this: suppose that you want to use the same SQL query with different arguments in several different places.In this case you can avoid code duplication by declaring the query body as a class query and then calling this query by name. This approach is also convenient for custom queries, in which the task of obtaining the next row is defined by a developer. Sounds interesting? Then read on!

Last comment 2 days ago
+ 15   1 10
4200

views

+ 15

rating

In the previous article, I have demonstrated a simple way to record data changes. At this time I have changed the "Audit Abstract Class" which is responsible for recording audit data and the data structure where the audit log will be recorded.

I have changed the data structure to a parent and child structure where there will be two tables to record the "transaction" and the "fields its values" changed on that transaction.

Take a look at the new data model:

Last comment 3 days ago
+ 6   1 8
387

views

+ 6

rating

Hello community!

 

I have a question about the %OnSave method of a class.  We have a class that  has two properties that are classes. 

Class A

Class B

Class C

Class A.PropertyB as Class B

ClassA.PropertyC as Class C

 

Classes B and C also need to point back to Class A - it's just the way it is.  We need to be able to use any one of these classes and get to the others (it's actually even more complicated than this, as Classes B and C also have a PropertyC and PropertyB as well, respectively) :

Last answer 9 days ago Last comment 9 days ago
0   0 1
62

views

0

rating

InterSystems IRIS 2019.1 has been out for a while and I would like to cover some enhancements for handling JSON which might have gone unnoticed. Dealing with JSON as a serialization format is an important part of building modern applications, especially when you interact with REST endpoints.

Last comment 1 October 2019
+ 22   8 11
1141

views

+ 22

rating

I have several BPL's that act like SQL Server Integration Services (SSIS) where they are transferring data. When I do this they are all being written under 1 session id, is it possible to make the BPL create multiple session ID's as it is cycling through a Snapshot, so it is easier to read in the trace?

Thanks

Scott Roth

Last answer 9 March 2018 Last comment 9 March 2018
0   0 3
308

views

0

rating

The Management Portal allows you to Export one or more globals to a file that you can then Import into that or another namespace.  However, the Management Portal can only be used to export entire globals.  For exporting selected nodes or subtrees within a global, a different utility is necessary.   This utility is the Export() classmethod in the %Library.Global class, which can export an entire global but also has the ability to export selected nodes or subtrees.

Last comment 5 September 2019
+ 7   0 6
991

views

+ 7

rating

Some time ago, InterSystems introduced the concept of %DynamicObjects.
This feature is a powerful tool that makes it very easy to convert any string of JSON text to objects and vice versa.
However, in the work that J2 Interactive is doing for our customers, there are a couple of things that "need some tweaking".

Last comment 30 August 2019
+ 2   2 1
187

views

+ 2

rating

I am still working on a generic task where I need to apply journal file records to another database. Initially I didn't want to use Journal.Restore class methods as I need to perform some data transformation, and it seemed that the clearest way to achieve it was to read journal file record by record using %SYS.Journal.Record API. 

Last answer 16 June 2018 Last comment 28 August 2019
+ 3   0 3
212

views

+ 3

rating

Hello everyone!

Does anyone know of a library that can be used to create Mock objects for Objectscript classes?

Right now, my team has been building mock objects by hand to help circumvent dependencies when writing and executing unit tests, but I always wondered if someone had ever created a Mock library like Mockito to help quicken the process. 

Thanks!

Last answer 10 October 2017 Last comment 26 August 2019
+ 3   0 4
393

views

+ 3

rating

Object Synchronization is a feature that has been around for a while, since Caché days, but I wanted to explore a bit more how it works. I've always thought that database automatic synchronization is complex by nature but, for some particular scenarios shouldn't be so hard. So I considered a very simple use case (OK, perhaps the typical one, I'm not discovering anything... but if it's common and it works, it's good wink ).

Last comment 19 August 2019
+ 6   2 2
203

views

+ 6

rating

Cogs Library

Over the next few months I will be releasing a number of open source libraries and tools to the Caché community.

Most of the code has evolved from previous production grade solutions over the years and I am collating it together under a single overarching library package that I am calling Cogs.

Last comment 3 August 2019
+ 17   4 9
1004

views

+ 17

rating

As a developer, you have probably spent at least some time writing repetetive code. You may have even found yourself wishing you could generate the code programmatically. If this sounds familiar, this article is for you!

We'll start with an example. Note: the following examples use the %DynamicObject interface, which requires Caché 2016.2 or later. If you are unfamiliar with this class, check out the documentation here: Using JSON in Caché. It's really cool!

Last comment 26 July 2019
+ 16   0 8
1359

views

+ 16

rating


Hello!

This article is a small overview of a tool that helps to understand classes and their structure inside the InterSystems products: from IRIS to Caché, Ensemble, HealthShare.

In short, it visualizes a class or an entire package, shows the relations between classes and provides all the possible information to developers and team leads without making them go to Studio and examine the code there.

If you are learning InterSystems products, reviewing projects a lot or just interested in something new in InterSystems Technology solutions — you are more than welcome to read the overview of ObjectScript Class Explorer!

Last comment 19 July 2019
+ 17   2 12
3563

views

+ 17

rating

When I start talking about InterSystems IRIS with more technically-minded people I always talk about how at the root of things it is a multimodel DBMS.

In my opinion that is the main advantage (on the DBMS side).

You want some sort of summary for your data? Use SQL!

Do you want to work extensively with one record? Use objects!

Want to access or set one value and you know the key? Think again. Use globals!

And the data is stored only once. You just choose the way you want to access it.

On the first overview it's a nice story - short and concise and it gets the message across, but when people really start working with InterSystems IRIS the questions start.

How are classes and tables and globals related? What are they to each other? How's data really stored?

In this article I would try to answer these questions and explain what's really going on.

+ 6   2 1
0

comments

234

views

+ 6

rating

Hi all,

 

we are wondering if anybody has a reporting tool that is capable using IRIS Objects?

I know there are things like Crystal Reports and others out there who can read the SQL Data throug ODBC but we need the capability of using object methods while running the report.

Since now we where using a JAVA based report generator (ReportWeaver) but since the object binding for JAVA doesn't exist anymore in IRIS data platform, did any of you have an alternative report generator?

 

Looking forward to any answers

 

cheers

Stephan

 

Last answer 13 July 2019 Last comment 16 July 2019
0   0 1
98

views

0

rating

Hey Intersystems-Developer,

 

I have already used that and know its possible, but can't find it anymore :(

 

I need dynamic access on proxy objects. For example:

set key = "lastName"

set name = obj.name

set lastName = obj.key <- Not possible 

set lastName = obj.GetAt(key) <- Not possible

 

How can I get access to that object with my dynamic variable "key" ?

 

Best regards. 

Last answer 9 July 2019 Last comment 9 July 2019
0   0 1
122

views

0

rating

Hi guys!

As you know there are two (at least) ways to get the stored value of the property of InterSystems IRIS class if you know the ID of an instance (or a record).

1. Get it by as a property of an instance with "Object access":

ClassMethod GetPropertyForID(stId As %Integer) As %String

{

set obj=..%OpenId(stId)

return obj.StringData

}

2. Get it as a value of a column of the record with "SQL access":

Last answer 29 June 2019 Last comment 6 July 2019
0   0 4
150

views

0

rating

Have some free text fields in your application that you wish you could search efficiently?  Tried using some methods before but found out that they just cannot match the performance needs of your customers?  Do I have one weird trick that will solve all your problems?  Don’t you already know!?  All I do is bring great solutions to your performance pitfalls!

As usual, if you want the TL;DR (too long; didn’t read) version, skip to the end.  Just know you are hurting my feelings.

Last comment 10 May 2019
+ 20   1 3
1396

views

+ 20

rating

How Tax Service, OpenStreetMap, and InterSystems IRIS
could help developers get clean addresses

 

Pieter Brueghel the Younger, Paying the Tax (The Tax Collector), 1640

 

In my previous article, we just skimmed the surface of objects. Let's continue our reconnaissance. Today's topic is a tough one. It's not quite BIG DATA, but it's still the data not easy to work with: we're talking about fairly large amounts of data. It won't all fit into RAM at once, and some of it won't even fit on the drive (not due to lack of space, but because there's a lot of junk). The name of our subject is FIAS DB: the Federal Information Address System database - the databases of addresses in Russia. The archive is 5.5 GB. And it's a compressed XML file. After extraction, it will be a full 53 GB (set aside 110 GB for extraction). And when you start to parse and convert it, that 110 GB won't be enough. There won't be enough RAM either.

+ 2   2 1
0

comments

186

views

+ 2

rating

First time post, also a new Cache developer, hence the <Beginner> tag.

If our data has Predefined terms in a dictionary, and a user can add terms on their own, can the terms exist in different tables?

Lets call the tables "Terms" and the user data in "UserTerms".

If a third class definition has a property of "Term" can it not be either Terms or UserTerms?

I'm leaning towards using a Subclass strategy where the pseudo "Parent" (forgive me) is  Dictionary.Term and the child is along the lines of Dictionary.Term.User

Last answer 26 March 2019 Last comment 28 March 2019
0   0 3
129

views

0

rating