Skip to main content
Previous section   Next section

Class Definitions

Work with class definitions and class members programmatically (obtain information about, define, make deployed, and so on).

Background Information

For a brief introduction to class programming, see “Basic Ideas in Class Programming” in the Caché Programming Orientation Guide. Many commercial books are also available on the subject.

For information on creating class definitions in Caché, see Using Caché Objects and the Caché Class Definition Reference. In Caché, a class member is a method, property, parameter, or other element of a class definition.

You typically use Studio to create, examine, compile, and export classes; see Using Studio.

Available Tools

%Dictionary package

Provides persistent classes you can use to examine class definitions, modify class definitions, create new classes, and even write programs that automatically generate documentation. There are two parallel sets of class definition classes: those that represent defined classes and those that represent compiled classes. For example, you can use %Dictionary.ClassDefinition to work with class definitions, and you can use %Dictionary.CompiledClass to work with compiled classes.

There are similar classes in the %Library package, but the latter classes are deprecated.

See “Class Definition Classes” in Using Caché Objects.

Availability: All namespaces.

Provides methods for working with class definitions and other Studio items. These include:

  • Compile()

  • Delete()

  • Export()

  • ExportAllClasses()

  • GetClassList()

  • GetDependencies()

  • IsUpToDate()

  • MakeClassDeployed()

  • ShowClasses()

  • UnCompile()

  • Upgrade()

  • And others

Availability: All namespaces.

Reminder

The special variable $SYSTEM is bound to the %SYSTEM package. This means that (for ObjectScript) instead of ##class(%SYSTEM.class).method(), you can use $SYSTEM.class.method().