Pattern Patter
Context
SolutionDivide the view into two parts. Let the main view display the "frame" (the parts that tend not to vary); let the main view also maintain a reference to a "renderer" that can display each repeated (variable) part. The renderer typically has a small interface (usually just one method), that takes as its arguments all information needed to display one cell. Typically, each view will have a default renderer, that takes the object to display, calls toString() on it, and displays that. This way, the default view is often good enough for a first cut. Uses
[Written 8-1-99.] |
|
Copyright 1994-2010, William C. Wake - William.Wake@acm.org |