Generated Feature Code

After you have defined the interface for a new part, VisualAge can generate C++ code for the interface's features.

Before generation, you must set generation properties in the Class Editor. In assigning file specifications, VisualAge uses the same file name root set for the part source code, but the file extensions are slightly different, as follows:

.cpv
A C++ code file.

.hpv
The header file for the .cpv file.

In most cases, code generated for attributes is sufficient for use without modification. Code generated for actions is skeletal but compilable--sufficient for visual construction, but you must eventually add the appropriate logic to the generated action code. Event code is automatically generated for all attributes, but if you wish to signal events from actions, you must add the notifyObservers call by hand.

VisualAge does not automatically include generated feature code in part source unless the appropriate generation options have been set in the Class Editor. You select which file types to be included. In addition to the file types listed above, VisualAge also supports inclusion of the following types:

.hv
A resource header file for the .cpv file. This file contains the resource IDs you are adding by hand.

.rcv
A resource file that contains any strings you are adding by hand.


Related concepts
Generated Part Code
Generated Application Code
Notification Framework
Generated Code

Related procedures
Generating Feature Code
Preparing for Code Generation

Related references
Class Editor