KCMS CMM Developer's Guide

Instantiation

You instantiate KCMS framework objects or any runtime derivations of that object with the following methods:

create()XXXX()

You allocate an object with the create()XXXX() method. This method combines sharing of the object with runtime derivative support. With chunk set-based objects, this function searches for a match through allocated objects. If it finds a match, it attaches to that object and returns its address. If it does not find a match or the object is not chunk set based, it searches for a match through objects in the runtime-loadable object files.

To maximize the runtime nature of the KCMS framework, it is recommended that you use the create()XXXX() method whenever possible within your CMM derivative. It enables derivatives statically linked into an application or included directly in the KCMS framework's shared object libraries (such as, libkcs) to use the correct and latest version of your CMM derivative.

Note that the KcsStatus class extension is an exception to this recommendation. It passes back a status string rather than a pointer to a derivative, and only two C functions are written.

attach()

You use the attach() method to share an object. If an object already exists, it can be shared in memory with this method. You can share the object with other users of that object. Any changes in the object are applied to objects that share it. If you share an object, make sure that object does not change while your derivative is attached to it.

new()

To get a new object of a specified type or a KCMS framework derivative, you use the new() method. This allows a runtime derivative to actually override a built-in type after it has been released.