« Increase your website performance | Main | Q&A with the New York Times Online Design Director »

New GalaxyGoo skillset: Caché ObjectScript

I recently started a new job where I'm working on library software and the technology we work with is Intersystem's Caché database engine (based on MUMPS). The language used to build the software is Caché ObjectScript, and last week I took an intensive 4-day course in writing OO applications using this language. So consider Caché ObjectScript the latest addition to the list of languages we at GalayGoo are familiar with :)

One of the strengths of Caché is that it uses a different approach to the typical SQL/relational database engines (MSSQL, MySQL, PostgreSQL, etc) which makes it much faster, altho SQL can be used to access data. For instance, the following line of code saves the value 100 into a multidimensional array inside a 'global' called MyStorage:

Set ^MyStorage(1,"key1","key2","key2",45) = 100

Globals can be thought of as tables. But one can also create a class with properties, methods, inheritance, etc and have the class represent a global (and thus a table) and use SQL to query the data.

The different approach to data and the fact the language is fairly old means there's really ' old school' code out there like:

s n1=$ll(rlist) i n1>0 f i1=1:1:n1 { w " " s n2=$ll($lg(rlist,i1)) i n2>0 f j=1:1:n2 {w $lg($lg(rlist,i1),j)," "} w ! }

(which does... something) and also OO class syntax like:

Class FCE.RealEstate Extends (%Persistent, %Populate, %XML.Adaptor) [ ClassType = persistent, ProcedureBlock ]

Property Street As %String [ Required ];

Property City As %String(POPSPEC = "City()") [ Required ];

Property State As %String(MAXLEN = 2, PATTERN = "2U", POPSPEC = "USState()") [ Required ];

Property Zip As %String(MAXLEN = 10, PATTERN = "5n.1(1""-""4n)", POPSPEC = "USZip()") [ Required ];

Method Print()
write ..Street_$$$NL_..City_", "_..State_" "_..Zip


which would represent a 'table' holding address-data, and which also provides a method to display an address.

Kristin and I have been talking about Caché and she's very interested in its capabilities and what it potentially can do for GalaxyGoo. So while I'm far from an expert or even a novice at this language, I'd be more than happy to answer any questions that might come up.