In most cases, if one class depends on another, the class compiler will detect this and determine the correct compilation order. For example:
- Compiling a superclass triggers compilation of its subclasses.
- Compiling a custom datatype class triggers compilation of any classes with a property of that type.
Yet sometimes, a developer needs to specify compilation order. InterSystems class definitions contain two keywords for this, DependsOn and CompileAfter, that are very similar but not identical.
.png)

