Article # 30, added by Geoworks, historical record
| first | previous | index | next | last |

Ordering static object instance data




When declaring static objects in a GOC program, it is a good idea to set
the values of the instance data in order of the class hierarchy. For
example, if you're declaring an object of GenControlClass, you would set
the GenClass instance fields first, then set the GenInteractionClass
fields you want, then finally set the GenControlclass fields. 
Here is an example: 

    @object GenControlClass Controller = {
        GI_visMoniker = "My Controller";
        GI_comp = @AddButton,
                  @CancelButton;  /* Not defined in this sample. */
        GII_visibility = GIV_DIALOG;
        GII_type = GIT_PROPERTIES;
        GCI_output = process;
    }

One reason for setting the instance data in this order is to force you to
look at each superclass and its instance data. By doing this, you are
less likely to forget to set a value in one of the instance fields.