Figure

Based on Excel's existing classes, you could just as well flip a coin when choosing between making Item a property or method.

What characteristics do you think would be useful for the Setting object? Some of the obvious ones include a Name property, a Value property, and a Delete method. A Description property would also be useful.

In order to implement different kinds of settings, I've also included a SettingType property. Using this property allows you to implement read-only or read-write settings. Table 12.2 shows members needed by the Setting class.

Table 12.2: Members of the Setting Class

Member Name

Type

Purpose

ChangeEditMode

Method

To turn on/off the ability to edit the setting.

Delete

Method

To delete the setting.

Description

Property

The description of the setting.

GetSetting

Method

This method initializes the object.

Index

Property

The index of the setting.

Name

Property

The name of the setting.

SettingType

Property

The type of setting (private, read-only, read-write, or read-protected write).

Value

Property

The value of the setting.

I didn't completely specify the class interfaces here. In particular, I left out the data types of the properties; nor did I specify any of the necessary parameters or their data types or the data type returned by each of the methods. I'll discuss these details as I dig into each object. Additionally, I left out an important property of the Setting class as a special surprise for later in the chapter.

0 0

Post a comment