Object::DoObserve

Section: ET++ method description (n)
Updated: automatically Fri Mar 1 10:54:57 1991
Index Return to Main Contents
 

NAME

Object::DoObserve - instance method  

TEMPLATE

void DoObserve(int objectId, int partCode, void * value, ObjPtr observedObject)  

SPECIFIERS

public virtual  

DESCRIPTION

This method is called by the method Send of the observedObject to inform its observers about a change in its state. DoObserve is called for objects only which have previously been registered as observers of the observedObject through the method AddObserver.
The first three arguments contain detailed information about the change.
If DoObserve has to be overridden because the inherited behaviour does not handle some cases, it is essential to partially override DoObserve. Not doing so would break the object communication patterns already established. As a rule-of-thumb, DoObserve is best overridden in post-order, i.e. handle the change message at the more specific level, and then at the more general level.
Clearly, the client may totally override it if he exploits the fact that there is no need to call the super class' DoObserve. This is not considered good programming practice since it introduces unnecessary remote dependencies along an inheritance path. The minimal overhead introduced by partially overriding DoOberve is neglectable in virtually all cases.
Examples for some change messages can be found in the class Text and the class TextView.
See technote 'Change Propagation'. Method is sometimes overridden.  

ARGUMENTS

int objectId

either the id of the changed object or
const cIdNone
int partCode

a code that describes the change message more detailed. It is usually one of the cPart...
constants.
void * value

an argument possibly nil whose type and semantics depend on the values of objectId
and partCode.
ObjPtr observedObject

the observed object which has changed and called this method
 

RETURN ARGUMENT

void

 

CATEGORIES

change propagation, overrider interface

 

FIRST DEFINITION

class Object  

FILES

implementation:
Object.C


 

Index

NAME
TEMPLATE
SPECIFIERS
DESCRIPTION
ARGUMENTS
RETURN ARGUMENT
CATEGORIES
FIRST DEFINITION
FILES

This document was created by man2html, using the manual pages.
Time: 00:40:25 GMT, March 30, 2022