Posted by
Schwab,Wilhelm K on
Jul 07, 2004; 7:55pm
URL: https://forum.world.st/Drawing-graphs-iin-Dolphin-tp3370875p3370911.html
Chris
> It's really just a labelling issue. The only real difference between a Model
> and any other Object is that a Model as an optimised implementation of the
> Observer pattern (#trigger, #when:send:to:, etc).
At the risk of confusing Peter (but he seems like he's ready for
this<g>), objects can be "models" without being derived from Model. You
are, of course, very correct about the optimizations for events, but
that is not essential to serve as a view's #model.
Peter, it is probably most important that you concentrate on building
something (one might say anything) that works without being too
concerned with details. Following some of the suggestions in this
thread will spare you some of the false starts that a few of us
obviously have in common. Once you have something the produces graphic
output, you can begin to enhance it. Feel free to ask for advice on
where to put your more presentation-oriented features, etc.
In general, a good approach to Smalltalk (by no means original to me)
is: (1) make it run; (2) make it work; (3) make it fast.
Smalltalk's flexibility allows you to make fairly sweeping changes with
little backlash (most of the time). Probably the first snag that you
should work to avoid is having errors in #onPaintRequired:. Chris traps
them (as do I in views); I generally draw to a bitmap first so errors
are not a problem, and simply lead to a walkback and then a debugger.
In fact, I generally don't bother with a presenter as I start a new
graphic; I write code to open an image presenter on the output only when
I _don't_ see a walkback :)
Have a good one,
Bill
--
Wilhelm K. Schwab, Ph.D.
[hidden email]