25.01.2015 Views

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. It resolves inheritance—it determines which methods, properties, and other class members<br />

are inherited from super classes. It stores this inheritance information into the Class<br />

Dictionary for later reference.<br />

3. For persistent and serial classes, it determines the storage structure needed to store objects<br />

in the database and creates the necessary runtime information needed for the SQL representation<br />

of the class.<br />

4. It executes any method generators defined (or inherited) by the class.<br />

5. It creates one or more routines that contain the runtime code for the class. The Class<br />

Compiler will group methods according to language (<strong>Caché</strong> ObjectScript and Basic) and<br />

generates separate routines, each containing methods of one language or the other.<br />

If you specify the “Keep Generated Source” option with the Class Compiler, you can<br />

view the source for the routines using the View Other command within Studio.<br />

6. It compiles all of the generated routines into executable code.<br />

7. It create a class descriptor. This is a special data structure (stored as a routine) that contains<br />

all the runtime dispatch information needed to support a class (names of properties,<br />

locations of methods, etc.).<br />

There are several ways to invoke the Class Compiler:<br />

• From within <strong>Caché</strong> Studio using the option in the Build menu.<br />

• From the <strong>Caché</strong> command line (terminal) using the Compile method of the %SYSTEM.OBJ<br />

object:<br />

Do $System.OBJ.Compile("MyApp.MyClass")<br />

Class Compilation<br />

Note that if you use SQL DDL statements to create a table, the Class Compiler will be automatically<br />

invoked to compile the persistent class corresponding to the table.<br />

<strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong> 23

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!