Home  /  Application Development: Core Topics  /  Class Definition Reference  /  Class Keywords  /  ClassType

Class Definition Reference
[Back]  [Next] 
InterSystems: The power behind what matters   

Specifies the type (or behavior) of this class.
To specify the type of class (if needed), use the following syntax:
Class MyApp.MyClass [ ClassType = classtype ]  { //class members }
Where classtype is one of the following:
If this keyword is not specified, the class type is inherited from the primary superclass, if there is one.
Note that ClassType is specified for system classes such as %RegisteredObject, %SerialObject, %Persistent, and data type classes, so you do not generally need to specify this keyword if you subclass those classes.
This keyword specifies how this class is to be used. The class compiler uses the ClassType keyword to determine how to compile a class. For example, if ClassType is persistent, the class compiler additionally invokes the storage compiler to generate persistence code for a class. Unless explicitly defined, the value of ClassType is either the default value or it is inherited from the primary superclass.
For persistent classes, an explicit ClassType statement is only required when standard persistence behavior is being overridden. If a class definition includes such a statement, it is either because a developer has specified it or because the class originated in code developed with an older version of InterSystems IRIS.
Effect on Subclasses
This keyword is inherited from the primary superclass. The subclass can override the value of the keyword.
If you omit this keyword, the class type is inherited from the primary superclass, if there is one.
See Also