The following checklists contain the items required to
implement a new part or to convert an existing class to a part.
Because parts are implemented as classes, you can convert
existing classes to parts and still use them as classes.
Make the following interface changes to support parts:
- To enable notification, make sure your class inherits
from the appropriate notifier.
- Define the constructors.
- Define a virtual destructor.
- If appropriate, define the assignment operator for
nonvisual parts.
- Define a public notification ID for each event.
- Define a public notification ID for each attribute.
- Define a public get member function with no parameters so
users can obtain the value of each attribute.
- If the attribute can be changed, define a public set
member function with a single parameter containing the
new value. If this attribute is a boolean, set the
default to true.
- Define any public action member functions. Consider reset
or default actions for attributes, including disable and
enable actions for boolean attributes.
Make the following code changes to support parts:
- Code each event notification ID using a string containing
the class name and event name.
- Code each attribute notification ID using a string
containing the class name and attribute name.
- Code the constructors and a virtual destructor.
- If defined, code the assignment operator.
- Code the public get member functions for each attribute.
- Code the public set member functions for each attribute.
Notify observers when the value changes.
- Call get and set member functions to return and change
attribute values in actions. In addition, notify
observers of events specified by the part.
Part Design Guidelines
Naming Guidelines for Parts and
Their Features