The Humble Dialog approach to MVC

Michael Feathers’ famous paper titled “The Humble Dialog Box” has a nice, simple summary of the steps require to develop a controller class for the model-view-controller pattern:

  1. Create a class for the smart object, and an interface class for the view. Pass the view to the smart object
  2. Develop commands against the smart object, test first. Write your tests against a mock view.
  3. Create your dialog class and implement the view interface on it. Gestures on the dialog should delegate to commands on the smart object. Calls from the smart object to the dialog should resolve to simple setter methods.

All the articles on Michael’s site are worth a read.

Comments