Caché ObjectScript
Encyclopedia
Caché ObjectScript is a part of the Caché database system sold by Intersystems Corp. The language is a functional superset of the ANSI-standard M (ie, MUMPS
MUMPS
MUMPS , or alternatively M, is a programming language created in the late 1960s, originally for use in the healthcare industry. It was designed for the production of multi-user database-driven applications...

) programming language. MUMPS programmers can run existing MUMPS routines under Caché with little or no change. Caché ObjectScript offers a number of additions to ANSI-standard M including integrated support for object-oriented programming, procedure and control blocks using { } syntax and relaxed whitespace limitations.

The language has private and public variables and globals. Global has a different meaning in this language than in most; it does not refer only to scope but also to permanence. Globals refer directly to items stored in the hierarchical database. Any global that is SET will retain its value across system shutdowns. Also, all globals have universal scope.

The scope of a private variable is the local function, the scope of a public variable is the entire process. Variables, private and public, may be single elements or complete multi-dimensional arrays.

An interesting characteristic of hierarchical databases is that the data is always sorted (basically the data structure is a B-tree
B-tree
In computer science, a B-tree is a tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time. The B-tree is a generalization of a binary search tree in that a node can have more than two children...

). There are no sorting functions in the language itself. To sort data in a different order, you create a new array with different indices and copy the original array to the new one.

All arrays are "sparse". Space is only allocated for nodes that contain values. The arrays are multi-dimensional, but it is easiest to think of them as tree structures, not as linear or rectangular storage.

The original scripting language
Scripting language
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

 for Caché
Caché (software)
InterSystems Caché is a commercial object database management system from InterSystems Corporation. It provides object and SQL access to the database, as well as allowing direct manipulation of Caché’s underlying data structures. The company claims Caché is the world’s fastest object database...

, Caché ObjectScript is an object-oriented language. One interesting feature of Caché ObjectScript is that it enables the intermixing of data access methods – developers may view data as object
Object (computer science)
In computer science, an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure...

s, as relational tables
Table (database)
In relational databases and flat file databases, a table is a set of data elements that is organized using a model of vertical columns and horizontal rows. A table has a specified number of columns, but can have any number of rows...

 (using SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

), or as multidimensional arrays. Also, unlike some other object language
Object language
An object language is a language which is the "object" of study in various fields including logic, linguistics, mathematics and theoretical computer science. The language being used to talk about an object language is called a metalanguage...

s, Caché ObjectScript allows stand-alone routines. It does not require that all code be part of some object class method.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK