Database Reference
In-Depth Information
Class
Definition
Class
Instances
CUSTOMER
Class Attributes
CustNo:
123456
CustName:
Robin James
City:
London
CustPhone:
071-409-3101
NoOfCustomers
Instance Attributes
CustNo
CustName
CustCity
CustPhone
CustNo:
257341
CustName:
Leon Renner
City:
Monaco
CustPhone:
93-25-24-98
Methods
Change-City
Update-Phone
Print
……………
CustNo:
236890
CustName:
Rita Wong
City:
Taipeh
CustPhone:
2-709-3949
Figure 20-4
Class, class instances, and methods
A
Class Attributes
B
Class Attributes
Instance Attributes
I
nstance Attributes
……………
……………
……………
……………
……………
……………
Methods
……………
……………
……………
Methods
Salary-Raise (increase)
Change-Addr
Print
……………
Figure 20-5
Sending of a message.
Messages
Object orientation may be considered as an object-message pattern.
Objects constitute the computational set in this pattern. Messages are the means
of communication between objects. Each object responds to a stipulated set of
messages.
A message is a simply a request from a sender object, say A, to a receiver object,
say B, asking B to execute one of B's methods. In a special case, an object A may
itself be both the sender and the receiver object.
Figure 20-5 illustrates how a message is sent from one object to another so that
one of its methods may be executed by the receiver.
Search WWH ::
Custom Search