From: Erik V. <eri...@hc...> - 2005-12-08 22:41:22
|
> > What we need is some kind of messages from the Model to the View > > about changes of individual values that have taken place > > and (possibly) need be reflected in the UI. > > I think you should revisit how we accomplished this for the > StockChart. In StockChart, we just call repaint() whenever > the model changes. I don't think there's any good reason why > ORWindow needs to be any different. In fact, we call refreshStockPanel(), which completely rebuilds the stock chart. > We don't need any sort of messaging subsystem if painting is > *only* dealing with drawing the objects that represent the > model as efficiently as possible. We can call repaint() as > often as we need to. But we don't. > So far, the painting code hasn't shown any indication that > it's too slow to be repeatedly repainted. Maybe not. But I wonder how this all would work out in a distributed environment. If the server would only send a message to all clients to have them all completely rebuild themselves, that will cause a lot of calls to the server! It seems to me that atomic update messages from server to client would do a more efficient job. Now I don't know for sure if Observer/Observable plus RMI would do that job, but I think it has a good chance. Erik. |