<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Model-View-Adapter</title>
	<atom:link href="http:///2009/04/20/model-view-adapter/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.palantirtech.com/2009/04/20/model-view-adapter/</link>
	<description>Articles from the Engineering Group at Palantir Technologies</description>
	<lastBuildDate>Tue, 24 Jan 2012 09:51:18 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Kevin</title>
		<link>http://blog.palantirtech.com/2009/04/20/model-view-adapter/comment-page-1/#comment-194</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Wed, 22 Apr 2009 07:58:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.palantirtech.com/?p=210#comment-194</guid>
		<description>Yep, Noel, that&#039;s another solution to the listener loop problem, although as you point out it can break down in multi-threaded scenarios.

BTW, one of my coworkers found a Sun article that covers similar ground, showing how to use the MVA pattern in a Swing app.  They go into more depth in some places, but don&#039;t push componentization of the Adapter quite as far:  http://blogs.sun.com/JavaFundamentals/entry/java_se_application_design_with</description>
		<content:encoded><![CDATA[<p>Yep, Noel, that&#8217;s another solution to the listener loop problem, although as you point out it can break down in multi-threaded scenarios.</p>
<p>BTW, one of my coworkers found a Sun article that covers similar ground, showing how to use the MVA pattern in a Swing app.  They go into more depth in some places, but don&#8217;t push componentization of the Adapter quite as far:  <a href="http://blogs.sun.com/JavaFundamentals/entry/java_se_application_design_with" rel="nofollow">http://blogs.sun.com/JavaFundamentals/entry/java_se_application_design_with</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Noel Grandin</title>
		<link>http://blog.palantirtech.com/2009/04/20/model-view-adapter/comment-page-1/#comment-192</link>
		<dc:creator>Noel Grandin</dc:creator>
		<pubDate>Tue, 21 Apr 2009 08:05:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.palantirtech.com/?p=210#comment-192</guid>
		<description>The other way to deal with listener loops is

&lt;pre&gt;
&lt;code&gt;
private boolean bDontFire = false;
public synchronized void fire() {
  try {
    bDontFire = true;
    ....update model or view...
  } finally {
    bDontFire = false;
  }
}

private class MyListener implements Listener {
  public void onEvent() {
     if (bDontFire) return;
     ... deal with event...
  }
}
&lt;/code&gt;
&lt;/pre&gt;
But even this can come unstuck when components fire events in a separate thread.</description>
		<content:encoded><![CDATA[<p>The other way to deal with listener loops is</p>
<pre>
<code>
private boolean bDontFire = false;
public synchronized void fire() {
  try {
    bDontFire = true;
    ....update model or view...
  } finally {
    bDontFire = false;
  }
}

private class MyListener implements Listener {
  public void onEvent() {
     if (bDontFire) return;
     ... deal with event...
  }
}
</code>
</pre>
<p>But even this can come unstuck when components fire events in a separate thread.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

