Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #5147

Re: Coalescing Updates in MVC?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.albasani.net!.POSTED!not-for-mail
From Lew <noone@lewscanon.com>
Newsgroups comp.lang.java.gui
Subject Re: Coalescing Updates in MVC?
Date Sat, 26 May 2012 12:02:05 -0700
Organization albasani.net
Lines 32
Message-ID <jpr9be$gg0$1@news.albasani.net> (permalink)
References <MVC-updates-20120524124948@ram.dialup.fu-berlin.de> <nospam-28098B.15535424052012@news.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net RfcumuU5h4foWCwEoQwdf3BGy6OMMl2kYXAULG2Wrjnrmz9ldhD48LKxVq1Na0x6EIoxMw3lmntMK4P6eU2rkqulmVT0RaIMeTa/87e8DbEglgXOUyEgxFq0j+xGnXgR
NNTP-Posting-Date Sat, 26 May 2012 19:02:06 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="m7OjfsUM69TLc4OI5pT+uvU3/qHv/uPonIrvGG9q7VpDFiVGi7uK6C6wxsxF/OmhFZKE7dhwJXDZCQM+xb/cjqfD/6IV//+0124MHzPVamBIpi6+9+iho8643UGpSl0S"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1
In-Reply-To <nospam-28098B.15535424052012@news.aioe.org>
Cancel-Lock sha1:iBOi5A6S8sMYg2LNyebFbtzJVaY=
Xref csiph.com comp.lang.java.gui:5147

Show key headers only | View raw


John B. Matthews wrote:
> Stefan Ram wrote:
>. . .
>> How is this usually handled?
>
> java.awt.Component coalesces certain mouse and paint events in
> coalesceEvents(), which is called by EventQueue.postEvent().
>
> When using javax.swing.Timer, isCoalesce() is true by default. In
> practice, this degrades gracefully on slower hardware.

I'm not sure coalescing model events is necessarily faster than processing 
them, depending on how things are staged and parallelized.

An event-processor loop can detect that it has multiple events pending when it 
tries to fetch one, and attempt to coalesce some before applying them to the 
model. But then you sort of need to model the effects of each event to know 
how they can coalesce, which is already the job of the model.

In the AWT case John mentions, it is view events that are coalesced. This 
makes sense - the graphics engine has a model of the display with which it can 
outpace the actual display using offscreen buffers and other tricks.

So the "M" part of the system applies its changes sequentially and atomically, 
firing off change notifications but not actually changing the "V" part. The 
model thus stays nimble and up to date. The "V" part is perforce slower, but 
the processing engine can coalesce events if it's faster than the display.

-- 
Lew
Honi soit qui mal y pense.
http://upload.wikimedia.org/wikipedia/commons/c/cf/Friz.jpg

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Coalescing Updates in MVC? "John B. Matthews" <nospam@nospam.invalid> - 2012-05-24 15:53 -0400
  Re: Coalescing Updates in MVC? Lew <noone@lewscanon.com> - 2012-05-26 12:02 -0700
    Re: Coalescing Updates in MVC? "John B. Matthews" <nospam@nospam.invalid> - 2012-05-28 23:30 -0400

csiph-web