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


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

Re: Coalescing Updates in MVC?

Path csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From Jeff Higgins <jeff@invalid.invalid>
Newsgroups comp.lang.java.gui
Subject Re: Coalescing Updates in MVC?
Date Thu, 24 May 2012 08:47:02 -0400
Organization A noiseless patient Spider
Lines 34
Message-ID <jplaj8$n79$1@dont-email.me> (permalink)
References <MVC-updates-20120524124948@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 8bit
Injection-Date Thu, 24 May 2012 12:46:32 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="lN5NBsxb/Hl+dKZczfqfVQ"; logging-data="23785"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18po3ZxjaYfNy4Vur03Em/JgabUpf5jqn8="
User-Agent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120507 Icedove/3.0.11
In-Reply-To <MVC-updates-20120524124948@ram.dialup.fu-berlin.de>
Cancel-Lock sha1:XFC20n7bulR+ctAQSyJlMnsHuqM=
Xref csiph.com comp.lang.java.gui:5141

Show key headers only | View raw


On 05/24/2012 07:02 AM, Stefan Ram wrote:
>    When a controller request many little changes of the model,
>    it might make sense to update the screen not after every little
>    update but only after the last update of the containing operation.
>
>    However, the model or view do not know after a little model
>    update whether there are more updates to come, so they
>    cannot decide whether to update now or later. Also the model
>    does not know whether an observer is a View or some other
>    entity that possibly might need to be notified of each
>    little update.
>
>    How is this usually handled?
>
>    I see one possibility to write the controller code as, e.g.,
>
> model.startCompoundChange();
> while( final Example example : container )model.add( example );
> model.endCompoundChange();
>
>    Where »startCompoundChange« and »endCompoundChange« will then
>    be broadcast to all observers of the model and the observers
>    now are free to only refresh the display after an »endCompoundChange«.
>
>    Another solution would be to send lightweight update
>    notifications to the View which then will start a timer to
>    update after, say, 0.1 s, ignoring all additional update
>    notifications for the same model that arive during that
>    time. But this might feel more sluggish to the end user,
>    because the visual feedback is delayed.
>
See Cocoa's NSNotificationQueue.
Some discussion is here:
<http://www.mikeash.com/pyblog/friday-qa-2010-01-08-nsnotificationqueue.html>

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


Thread

Re: Coalescing Updates in MVC? Jeff Higgins <jeff@invalid.invalid> - 2012-05-24 08:47 -0400

csiph-web