The Humble Dialog Box

A paper at ObjectMentor, by MichaelFeathers:

http://www.objectmentor.com/resources/articles/TheHumbleDialogBox.pdf

It describes a design technique to facilitate testing of GUIs, which involves keeping all logic out of the dialog box, but instead putting it in a non-GUI class that essentially has a one-to-one mapping of typical view functions. You can then easily create a mock view to guarantee the contract between this class and the view, and then finally create "The Humble Dialog Box". As stated in the paper, "Notice that each [dialog box] action method is very small, just a simple delegation. Every method that receives data on the view is as close to a pure �set� method as possible."

-- JeffTulley


Also described as ModelViewPresenter, Martin Fowler has a similar page:

http://www.martinfowler.com/eaaDev/ModelViewPresenter.html

-- PhilThompson?


TheHumbleDialogBox is not quite the same as ModelViewPresenter. The key to the pattern is a totally passive view containing only setters. You can have ModelViewPresenter without that.

Another article of Martin Fowler is more specific to the Humble View (which is the concept of the Humble Dialog Box):

http://www.martinfowler.com/eaaDev/uiArchs.html#HumbleView


EditText of this page (last edited September 8, 2010) or FindPage with title or text search