Home Segments Index Top Previous Next

793: Mainline

To see the model–viewer–controller paradigm at work on a deeper level, you start by creating subclasses of the Model, View, and Controller classes. Note that instances of the ModelSubclass class have two instance variables, x and y, in the following definition:

ModelSubclass class definition 
Model subclass: #ModelSubclass 
  instanceVariableNames: 'x y' 
  classVariableNames: '' 
  poolDictionaries: '' 
  category: 'Experiment' 
ViewSubclass class definition 
View subclass: #ViewSubclass 
  instanceVariableNames: '' 
  classVariableNames: '' 
  poolDictionaries: '' 
  category: 'Experiment' 
ControllerSubclass class definition 
Controller subclass: #ControllerSubclass 
  instanceVariableNames: '' 
  classVariableNames: '' 
  poolDictionaries: '' 
  category: 'Experiment' 

You need these classes so that you can define certain illustrative methods without either cluttering up the system-supplied classes or obliterating existing methods on which other subclasses depend.