Skip to main content

Putting Classes in Deployed Mode

Putting Classes in Deployed Mode

You might want to put some of your classes in deployed mode before you send them to customers; this process removes the source code so that it cannot be examined or modified.

For any class definitions that contain method definitions that you do not want customers to see, compile the classes and then use $SYSTEM.OBJ.MakeClassDeployed(). For example:

 do $system.OBJ.MakeClassDeployed("MyApp.MyClass",,1)

If the third argument (fullDeploy) is 1, the method removes the majority of the class definition, leaving the minimum so the class is runnable. For persistent, serial, or XML-enabled classes, because the runtime requires more of the class definition to be present, the method instead just removes the method implementations. See %SYSTEM.OBJOpens in a new tab for details.

For an alternative approach, see Adding Compiled Code to Customer Databases.

About Deployed Mode

When a class is in deployed mode, its method and trigger definitions have been removed. (Note that if the class is a data type class, its method definitions are retained because they may be needed at runtime by cached queries.)

You cannot export or compile a class that is in deployed mode, but you can compile its subclasses (if they are not in deployed mode).

There is no way to reverse or undo putting a class into this mode. You can, however, replace the class by importing the definition from a file, if you previously saved it to disk. (This is useful if you accidentally put one of your classes into deployed mode prematurely.)

FeedbackOpens in a new tab