Render Delegation
Submitted by Zachary Booth Simpson
on 12/5/2000

2000 - Zachary Booth Simpson. Copied with permission from If you find any of this work useful, please sign Zack's guest book:


Pass-off special render cases to Model code.


Generic View code often becomes clotted with special cases, especially near the end of a project. Render Delegation gets the special cases out of the View code and into Model subclasses.


An example clot in View code:
if (typeToDraw==DARTH_VADERS_SHIP)

To encapsulate these kinds of special cases, the View delegates the draw back to the Model. For example: objectToDraw->draw(x,y)

It is common for the view to do the transformation and sorting work and pass screen coordinates to the draw method of a model.


Not available at this time.


No examples at this time. Email to contribute.

Issues and Risks

Use Render Delegation when:
  • You want to ensure reusability / encapsulation of the renderer.
  • The View code becomes clotted with special cases.
  • Every model tends to have a different implementations of render.
  • Don't use Render Delegation when:

  • There are only a few special cases and the cost (compile time, encapsulation) of including render interfaces in Model code is very high.
  • Related Patterns

    Render Delegation passes draw commands from View to Model.

    Render Delegation may be part of an Appearance Map.

    Discuss this article in the forums

    Date this article was posted to 6/19/2001
    (Note that this date does not necessarily correspond to the date the article was written)

    See Also:
    Design Patterns

    © 1999-2011 All rights reserved. Terms of Use Privacy Policy
    Comments? Questions? Feedback? Click here!