Refining the .idl file for a class is typically an iterative process. For
example, after running the IDL source file through the SOM Compiler and
writing some code in the implementation template file, the class implementer
realizes that the IDL class interface needs another method or attribute,
a method needs a different parameter, or any such changes.
As mentioned earlier, the SOM Compiler (when run using the c or xc
emitter) assists in this development by reprocessing the .idl file and
making incremental updates to the current implementation file. This
modify-and-update process may in fact be repeated several times before the
class declaration becomes final. Importantly, these updates do not disturb
existing code for the method procedures. Included in the incremental update
are these changes:
- Stub procedures are inserted into the implementation
file for any new methods added to the .idl file.
- New comments in the .idl file are transferred to the
implementation file, reformatted appropriately.
- If the interface to a method has changed, a new method
procedure prototype is placed in the implementation file. As a precaution,
however, the old prototype is also preserved within comments. The body of
the method procedure is left untouched (as are the method procedures for
all methods).
- Similarly left intact are preprocessor directives,
data declarations, constant declarations, non-method functions, and additional
comments-in essence, everything else in the implementation file.
Some changes to the .idl file are not reflected automatically in
the implementation file after an incremental update. The class implementer
must manually edit the implementation file after changes such as these in
the .idl file:
- Changing the name of a class or a method.
- Changing the parents of a class (see also "If you
change the parents of a class..." later in this topic).
- Changing a functionprefix class modifier
statement.
- Changing the content of a passthru statement
directed to the implementation (.c, .C, or cpp) file. As previously emphasized,
however, passthru statements are primarily recommended only for placing
#include statements in a binding file (.ih, xih, .h, or .xh file) used as
a header file in the implementation file or in a client program.
- If the class implementer has placed "forward declarations"
of the method procedures in the implementation file, those are not updated.
Updates occur only for method prototypes that are part of the method procedures
themselves.
[Back]
[Next]