Skip to main content

Introduction to InterSystems IRIS Object Classes

Introduction to InterSystems IRIS Object Classes

InterSystems IRIS provides object technology by means of the following object classes: %Library.RegisteredObjectOpens in a new tab, %Library.PersistentOpens in a new tab, and %Library.SerialObjectOpens in a new tab.

The following figure shows the inheritance relationships among these classes, as well as some of their parameters and methods. The names of classes of the %Library package can be abbreviated, so that (for example) %PersistentOpens in a new tab is an abbreviation for %Library.PersistentOpens in a new tab. Here, the items in all capitals are parameters and the items that start with percent signs are methods.

The classes %Persistent and %SerialObject inherit the parameters and methods of the parent class %RegisteredObject.

In a typical class-based application, you define classes based on these classes (and on specialized system subclasses). All objects inherit directly or indirectly from one of these classes, and every object is one of the following types:

  • A registered object is an instance of %RegisteredObjectOpens in a new tab or a subclass. You can create these objects but you cannot save them. The other two classes inherit from %RegisteredObjectOpens in a new tab and thus include all the parameters, methods, and so on of that class.

  • A persistent object is an instance of %PersistentOpens in a new tab or a subclass. You can create, save, open, and delete these objects.

    A persistent class is automatically projected to a table that you can access via InterSystems SQL.

  • A serial object is an instance of %SerialObjectOpens in a new tab or a subclass. A serial class is meant for use as a property of another object. You can create these objects, but you cannot save them or open them independently of the object that contains them.

    When contained in persistent objects, these objects have an automatic projection to SQL.

Note:

Via the classes %DynamicObjectOpens in a new tab and %DynamicArrayOpens in a new tab, InterSystems IRIS also provides the ability to work with objects and arrays that have no schema; for details, see Using JSON.

FeedbackOpens in a new tab