Home Segments Index Top Previous Next

787: Mainline

In VisualWorks, instances of the Model class and the DependentPart class work together. The work begins when the model instance sends itself a change message:

                                          *---------------* 
                I have changed!   *------ |               | 
                (change: message) |       | Model         | 
                                  *-----> |               | 
                                          *---------------* 

The sole purpose of a change message is to activate a method in the model that sends update messages to dependent parts, telling those dependent parts that a change in the model may require an update in the dependent parts:

*---------------*                         *---------------* 
|               |   I have changed!       |               | 
| DependentPart | <---------------------- | Model         | 
|               |   (update: message)     |               | 
*---------------*                         *---------------* 

Then, the dependent part examines the model to see what exactly has changed, and responds accordingly:

*---------------*                         *---------------* 
|               |   What is new?          |               | 
| DependentPart | ----------------------> | Model         | 
|               |   (Mediated by getter)  |               | 
*---------------*                         *---------------*