Your Ad Here

Monday, October 20, 2008

Messages

Some object–oriented languages refer to calls to member functions as messages. Thus the call

s1.show data();

can be thought of as sending a message to s1 telling it to show its data. The term message is not a formal term in C++, but it is a useful idea to keep in mind as we discuss member functions. Talking about messages emphasizes that objects are discrete entities and that we communicate with them by calling their member functions. Referring to the analogy with company organization in Chapter 1, it’s like sending a message to the secretary in the sales department asking for a list of products sold in the southwest distribution area.

No comments: