[Perl-widget-developer] Widget display/html output method name
Status: Alpha
Brought to you by:
spadkins
|
From: Gunther B. <gu...@ex...> - 2001-06-03 15:38:07
|
At 02:17 PM 6/3/01 +0200, Issac Goldstand wrote:
> > I would like to open up the debate about the use of 'display' or 'html'
> > again. I am wondering about the possibility of confusion between
> > 'displaying' the code that generates the widget, and 'displaying' the
> > value of the widget. Also, display() seems to imply a print. What if we
> > got rid of both html() and display() and used draw() or render() for
> > generating the code, and leave value() as it is. Or, if you want, you can
> > shoot me for opening up this can of worms again :)
> >
>
>How about activate() or something else that can generically describe the
>Widget... Theoretically, we could creaate a Timer widget (that does some
>event after a certain time elaplses). In such a case, words like "display"
>"draw" or "render" don't make sense... Of course, we're not really
>"activating" the widgets either, as we're creating them on-the-fly in the
>target environment (e.g., HTML), but my personal hilosophy when designing
>"thing"s to be used by developers is to try to pick names for methods and
>properties that are easy to understand and _make sense_... They'll
>appreciate it.
I agree that display, draw or render seems quite active as if to imply
print. But these are fairly standard (especially draw) in GUI systems. The
fact that a component is draw() was called doesn't actually mean it is
displayed. In some cases, the draw can be just placed on a backend bitmap
which will never display (double buffering).
I dislike the name draw because it has a connotation of raw bitmaps (like
drawing programs).
By far, the best method name I have seen is render. It is semantically
accurate. The widget is being rendered but it's not being displayed.
Activate is one that I dislike because it implies you do it once or implies
a state change (active/inactive). This is not true. There is a distinct
value being returned when render() would be called.
Later,
Gunther
|