LuCk said:
Can someone explain what these really are for example:
The term has nothing really with the language per se. It stems from
the notion of a "property" or a "trait" of a particular "object" in
Object-Oriented terminology.
It is said that objects may exhibit certain quantifiable traits, which
in programming can be represented by member functions called "accessors".
Those traits can be implemented as values stored directly or calculated
using some kind of specific to the object algorithm.
In your example, the "frame rate" characteristic is _set_ by the function
but in the implementation we can see that the "frame rate" is not stored
directly but rather "frame delay" is calculated and stored.
The usual way to name those functions is "set..." or "get..." where the
ellipsis represent the trait being set or obtained. For example, class
Car could have a characteristic called "Speed", and the accessor
functions for it would be "setSpeed" and "getSpeed". However, it would
probably not have "speed" as a stored value, but rather the current gear
engaged and the current degree of the gas pedal depression, which
influences how fast the car is going. The implementation of "getSpeed"
would query the "speedometer" [sub]object to obtain the reading, and the
implementation of "setSpeed" would depend on the current speed at which
the car is moving to direct some force to either the gas pedal or to the
brake pedal while the reading of the speedometer is observed until the
speed reaches the required value. That's called "algorithm". However,
to the observer of the car it needn't be known. The observer just calls
"setSpeed" with a value and expects the car to respond somehow.
Well, you probably would benefit from a decent book on OOD. Ask in the
comp.object newsgroup what they recommend for beginners.
Victor