Design for the OAContractor Part

When you design a VisualAge part, you are designing a C++ class. The part interface corresponds to the interface of the underlying class. The class can also have member functions (public, protected, or private) that do not exist in the part interface.

The OAContractor part has the following attributes:

All attributes are of type IString, except for the activeStatus and IDvalid attributes, which are of type Boolean. The contractorID attribute is derived from the contractor's name attributes.

To enable you to use these attributes, the contractor part must also contain public get and set member functions. By convention, the names of these member functions follow a pattern determined by the name of the attribute. For the IString attribute lastName, the get member function is called lastName, and the set member function is called setLastName. For the Boolean attribute activeStatus, the get member function is called isActiveStatus, and the set member function is called enableActiveStatus.

To retrieve or update contractor information from the database, the OAContractor part contains the following actions:

The clear action empties an instance of its current state. The parseName action parses an input string to set the firstName, middleInitial, and lastName attributes. The getContractor and putContractor actions use the derived attribute contractorID to retrieve and store contractor information in the database.

OAContractor has an event, queryFound, that is signaled from the getContractor action when the designated record is found in the database.

The feature code for this part appears in contrctr.cpv.


Related references
Design of Nonvisual Parts for OASearch
Design for the OAContractorView Part