#Object Data Model

0 Followers · 499 Posts

An object data model is that data or code is composed of modules that combine data and procedures that work on the data.

Learn more.

Question Michael Gosselin · Jul 29, 2016

Hello,

I've been doing this for years.  Well, decades.  And, I pride myself in being able to break other people's code.

However, sometimes I don't apply the same dedication to breaking my code.  That needs to change. wink

So, I'd like to ask people, what are some of the things you like to test for when trying to stress-test your code?  I'll start with what I like to try testing to see what crashes, what works unexpectedly, and what I've handled.

I always test the following: 0; 1; -1; some 20-digit number; some 50-character string; 1/0; 2E12; " ", and an undefined variable.

6
0 616
Question John Murray · Jul 28, 2016

Studio's "Package Information" dialog, accessed from the context menu of a package on the Namespace tab of the Workspace pane, includes a field titled "Routine Prefix"

Help says this is a "String that is used as a prefix for the routines generated from classes in this package".

But if it set a string here, then recompile a class in the package, it doesn't affect the name of the generated routine(s). Nor does it influence the routine names generated when I create new classes in the package and compile them. I have tested on 2016.1.

2
0 424
Question Wendy Griffiths · Jul 22, 2016

I want to override the Get and Set methods of a class property.  The class maps to a pre-existing global. The property is defined like so:

Property Invalid As %Library.Boolean;

with the property mapping to a node like ^GLOBAL(Code,"INVALID")=1
Code is a property in the same class.

The value can be 0 or 1 or the node might not exist. When it doesn't exist I want the value of the SQL field to come out as 0 (false).

12
0 1838
Question Kevin Furze · Jul 26, 2016

Cache 2015.2

I need to get a sort order stored in my database with mutiple decimal places, but I want the string stored and retrieved EXACTLY as I enter it. so if someone enters 700.3000 I don't want cache to treat it as a decimal and strip the trailing zeros storing it as 700.3

once it comes back, I want the sorting to sort AS STRINGS, again, none of that stripping training/leading zeros.

this ay, I can create local arrays in exactly the order they think? they created them

3
0 533
Question Rustam Ibragimov · Jul 26, 2016

Hello, guys.

I have a set of file names (e.g. file.cls, file2.mac and so on) and I need to check whether these files are mapped in %ALL or current namespace.

I found that if I open Globals in the current namespace I can see mapped packages. And If I open this global I see all files that are  to this namespace and %SYS. The problem is these files are enumerated in a json object(apparently)

ex. "{""class"":{""%Activate.Enum"":{},""%Activate.GenericObject"":{""CreateObject"":0,""GetObject"":0},""%Activate.HandleEvents"")

But, is there a way to determine whether this file is mapped using some method? 

1
0 395
Question Adrian Kerr · Jul 25, 2016

Let's say that we wish to store the documents sent to us via all of our Customers, and that the documents could be in PDF, spreadsheet, RTF, plain text, Comma-Separated-Values and XML.

It would be hoped that %Stream.Object would be a good choice of property to hold these documents, especially as you would expect %Stream.Object to morph between BINARY (for PDF, spreadsheet, RTF) or CHARACTER (for plain text, CSV, XML) depending on which type of stream was being persisted.

3
0 468
Article Timur Safin · Jul 18, 2016 15m read

This article created as side effect of preparations to the longer set of articles about simple, but still handy MapReduce implementation in Caché. I was looking for relatively easy way to pass arguments to (potentially) multiple targets via remote calling facilities. And after several attempts I have realized that we do have very powerful mechanism in the Caché ObjectScript which might be of particular help here – dynamic dispatch for methods and properties.

7
0 1289
Question Rustam Ibragimov · Jul 20, 2016

Hello, guys. 

I want to add a class to my project. This class is in UDL format. 

I know that there is a method:  ##class(%Compiler.UDL.TextServices).SetTextFromStream. The problem is that to use this method I need to know the name of the class (including all packages) in advance. But,  a class can have any name(I mean C:/source/AAA/BBB/CCC.cls, but the real name is Sample.Human.cls).

For now I found only one way to get to know the name of a class - just parse the class code and search for a word which is followed by "Class" word. Is there any better way to do that? 

6
0 464
Question Rustam Ibragimov · Jul 15, 2016

Hello, guys.

I have an external file that contains data in UDL format(as in Studio, not XML) and I need to somehow overwrite my source file with that file. 

I tried to use this snippet for .mac file

 set rtn = ##class(%RoutineMgr).%OpenId("les.mac")
 rtn.Code.WriteLine("some text")

It says that status is 1, but I don't see any difference in my source file.

Is there any way to overwrite source files, not only .mac but .cls, .int, .dfi?

4
0 637
Question David Losiewicz · Jun 23, 2016

I am testing application code and want to simulate error conditions. 

I am trying to use the following to define a custom error with a class method.

$SYSTEM.Status.Error($$$GeneralError,"Any text here")

My class method code looks like this....

set RunStatus=$System.Status.Error($$$GeneralError,"DXL Testing Run Error")

Class compile fails because the $$$GeneralError is unknown. 

ERROR: DBMS.Reports.TaskPage.1(5) : MPP5610 : Referenced macro not defined: 'GeneralError'
 TEXT: set RunStatus=$System.Status.Error($$$GeneralError,"DXL Testing Run Error")
 

5
0 1452
Job Fred Gustafsson · Jun 22, 2016

Job Description
Caché Objects Web Developer


 

An excellent opportunity exists for an enthusiastic Caché Objects full stack web developer to join our rapidly growing company based near Old Street.

The Job

Our customers use our software to manage events, from small meetings to high-profile conferences and shows. The quality of our software is critical to their success, and critical to our business.

0
0 594
Question Daniel Kutac · Jun 21, 2016

Customer is using an ancient MSM based client Workstation for their application and they made a small change to their server code. They introduced property of %Double() and discovered an issue. The MSM workstation is not able to retrieve any property of an object instance that holds value of $double(0). see images illustrating the issue.

I'm posting this to DC intentionally before I eventually send it to WRC so others can comment.

Dan

Image 1 - data

image 2 - UI

1
0 590
Question Francis Galiegue · Apr 27, 2016

Hello,

I am still a beginner with COS and am struggling with these concepts. While digging through the official documentation will eventually tell you everything you need to know, getting started is nevertheless not an easy feat...

Is it possible to create a "lists/array/multidimensional 101" page for beginners? And, for instance, its interaction with $data, what it means to use "as list of something" or "as array of something", how to walk lists, how to add/remove elements, how to extract sublists etc?

12
0 654
Question Andy Richards · Jun 1, 2016

I have a production system that has a large dataset of about 2 million rows. I need to create an index on a property but don't want it available to queries until the index is fully populated. Is there a way I can create the indexed, fire off the build, then "activate" the index so queries can use it.

3
0 519
Question Mark Bolinsky · May 19, 2016

Consider a design where there could be three or four or more servers and there is a need to have these eventually consistent between them all (and not considering database mirroring here).  

The current Caché documentation here demonstrates this well using object synchronization between two servers, however it doesn't indicate whether more than two servers can participate to create a "mesh type" deployment.  Below is a diagram of what I'm curious to know is possible to implement with Object Synchronization.

2
0 427
Article Mark Hanson · May 11, 2016 1m read

Often when debugging COS code you get an error message such as '<UNDEFINED>test^routine *test' so the first thing you want to do is to take a look at this code and see what it is doing. From the command line you can:

ZLOAD routine ZPRINT test

Which means splitting the $zerror information into the routine name and the line and adding the zload/zprint commands. Also you often want to view the lines above the one where the error happened as this gives you some context of how you got to this line, using ZPRINT you could 'ZPRINT +1:test' but that may display hundreds of lines.

6
0 1002
Article Nikita Savchenko · May 6, 2016 8m read

Greetings! This article describes yet another simple way of creating installers for the solutions based on InterSystems Caché. The topic covers applications, which can be installed or completely removed from Caché with one action only. If you are still documenting installation instructions that have more than one step to do to install your application — it’s high time you automated this process. 

14
0 1807
Question Michael (Liberty) Baker · May 9, 2016

I was writing a routine that called some class methods and when I typed in ##class( and the package, there was a drop down list of all the classes that match that package but when I selected one of the dropdown entries it added the package name again.

For example if I enter ##class(dim.

I am presented with a list of classes in the dim package but when I selected one of them,(dim.OccupationList), what ended up in the editor was

##class(dim.dim.OccupationList

1
0 439
Question Richard Housham · Apr 22, 2016

Hi this is my first post, so a little about my background. I've been programming in PHP/JavaScript for about 10 years.  
I've got quite a bit of knowledge surrounding object orientated programming and know the basics.

Last year I looked into the Mirth integration engine and did some work around that.

I've now moved jobs and I'm doing some work (surprise, surprise) with Ensemble.

1
0 714
Question Eduard Lebedyuk · Apr 10, 2016

Here's my code (download):

Class Utils.Generators [ Abstract ]
{

ClassMethod B()
{
    s ^a = 1
}

ClassMethod A() [ CodeMode = objectgenerator, GenerateAfter = B, PlaceAfter = B ]
{
    k ^a
    do ..B()
}

Now, obviously for it to work I need method B compiled and ready to use before compiling method A().

I test it with the following code:

do $system.OBJ.UnCompile("Utils.Generator")
do $system.OBJ.Compile("Utils.Generator")

Yet, I receive the following compilation error:

2
0 994