| << 6.2.0- Programming with Objects | Chapter6 | 6.2.2- Setting Up the Telephone Object Example >> |
The Software Telephone Object
So now we are shifting gears here from describing the real-world telephone as an object to describing a software telephoneobject. This is an example of representation. The properties of the telephone object are:
| Property Name |
| Color |
| Material |
| Weight |
| NumberOfKeys |
| TelephoneNumber |
| Connected |
As you can see, we have used the same names that we usedwhen discussing the physical telephone object. The methods of the telephone object are the same as well. In this case,the methods that have parameters will have the same parameters as well:
| Method Name | Parameters |
| PlaceCall | NumOutgoing |
| Answer | No Parameters |
| HangUp | No Parameters |
| SendCardNumber | NumCCN, NumPIN |
| Disconnect | No Parameters |
Finally – as you will expect by now – events that theobject will support are the same events that are supported by the physicaltelephone object:
| Event Name | Parameters |
| IncomingCall | NumIncoming |
| LineBusy | No Parameters |
| CallWaiting | NumIncoming |
Now that we have defined the interfaces of our telephone object, we can take a look at some codeexamples that will show you how to use these interfaces. For these examples, wewill be using VBScript, which is the language that is being used throughout thebook. Since there are three types of interfaces, we will look at three codesamples – one for each type.
| << 6.2.0- Programming with Objects | Chapter6 | 6.2.2- Setting Up the Telephone Object Example >> |

RSS

