Page

6.2.1- The Software Telephone Object

  by NT Community Manager.
Last Updated  by NT Community Manager.  

PublicCategorized as 06. Objects, Properties, Methods and Events.

Not tagged.
<< 6.2.0- Programming with ObjectsChapter66.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 ObjectsChapter66.2.2- Setting Up the Telephone Object Example >>

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |