<?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/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Günther Noack's blog</title>
	<atom:link href="http://gnoack.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://gnoack.wordpress.com</link>
	<description>Illustrated musings about the computer science world</description>
	<lastBuildDate>Tue, 20 Oct 2009 19:02:57 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Grr is now part of the GNUstep Application Project by Olf</title>
		<link>http://gnoack.wordpress.com/2009/10/16/grr-is-now-part-of-the-gnustep-application-project/#comment-2775</link>
		<dc:creator>Olf</dc:creator>
		<pubDate>Tue, 20 Oct 2009 19:02:57 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=641#comment-2775</guid>
		<description>FaKe! Obviously PhOtoshoped!</description>
		<content:encoded><![CDATA[<p>FaKe! Obviously PhOtoshoped!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Grr is now part of the GNUstep Application Project by Maintainers wanted &#171; Günther Noack&#8217;s blog</title>
		<link>http://gnoack.wordpress.com/2009/10/16/grr-is-now-part-of-the-gnustep-application-project/#comment-2772</link>
		<dc:creator>Maintainers wanted &#171; Günther Noack&#8217;s blog</dc:creator>
		<pubDate>Fri, 16 Oct 2009 09:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=641#comment-2772</guid>
		<description>[...] 2007 April 18    by guenthernoack   Update: Grr is now maintained by the GAP project, DictionaryReader continues to be part of the Etoile [...]</description>
		<content:encoded><![CDATA[<p>[...] 2007 April 18    by guenthernoack   Update: Grr is now maintained by the GAP project, DictionaryReader continues to be part of the Etoile [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Software Craftsmanship by Magda Gerritsen</title>
		<link>http://gnoack.wordpress.com/2009/08/05/software-craftsmanship/#comment-2770</link>
		<dc:creator>Magda Gerritsen</dc:creator>
		<pubDate>Tue, 06 Oct 2009 14:37:22 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=581#comment-2770</guid>
		<description>hey günther!!!!!!!!!!!!!!! längst wollt ich mich mal melden, ganz herzlichen dank noch für die postkarte aus zürich, die stadt u das land, wo man noch seltsamer spricht als hier in bayern;-) wie ists denn dort so gelaufen? 
deinen blog finde ich SEHR schick, irgendwie ist er ganz neu aufgezogen, oder? ich muss nun weiter an meinem kram hier basteln (heute steht xslt auf dem programm), ich bin weiterhin guter dinge und motiviert, abends immer leicht kaputt ... wie gehts mit deiner abschlussarbeit voran? hast du schon ein thema? bestimmt interessant!! viele liebe grüße von magda</description>
		<content:encoded><![CDATA[<p>hey günther!!!!!!!!!!!!!!! längst wollt ich mich mal melden, ganz herzlichen dank noch für die postkarte aus zürich, die stadt u das land, wo man noch seltsamer spricht als hier in bayern;-) wie ists denn dort so gelaufen?<br />
deinen blog finde ich SEHR schick, irgendwie ist er ganz neu aufgezogen, oder? ich muss nun weiter an meinem kram hier basteln (heute steht xslt auf dem programm), ich bin weiterhin guter dinge und motiviert, abends immer leicht kaputt &#8230; wie gehts mit deiner abschlussarbeit voran? hast du schon ein thema? bestimmt interessant!! viele liebe grüße von magda</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Subversion-aware bash prompts by Frank</title>
		<link>http://gnoack.wordpress.com/2009/10/06/svn-bash-prompts/#comment-2769</link>
		<dc:creator>Frank</dc:creator>
		<pubDate>Tue, 06 Oct 2009 14:22:46 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=615#comment-2769</guid>
		<description>Have a look at PROMPT_COMMAND (http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x264.html)

This is my custom one, which updates the prompt and the terminal name.

&lt;code&gt;
function promptcmd() {
  GITBRANCH=&quot;&quot;
  GITBRANCH_SHORT=&quot;&quot;
  if GITBRANCH=$(git-symbolic-ref HEAD 2&gt; /dev/null); then
    GITBRANCH_SHORT=&quot;${GITBRANCH#refs/heads/}&quot;
    GITBRANCH=&quot; (${GITBRANCH_SHORT})&quot;
  fi
  USER_SHORT=${USER:0:1}
  HOSTNAME_SHORT=${HOSTNAME%%.*}
  TIMESTAMP=$(date &quot;+%a %H:%M:%S&quot;)
  PS1=&#039;${debian_chroot:+($debian_chroot)}$TIMESTAMP $USER_SHORT@\h:\w$GITBRANCH\$ &#039;
  LOC=${PWD}
  if [ &quot;$GITBRANCH_SHORT&quot; = &quot;&quot; ]; then
    LOC=${PWD}
  else
    LOC=${GITBRANCH_SHORT}
  fi
  if [ &quot;$LOC&quot; = &quot;/home/psycho&quot; ]; then
    LOC=&quot;~&quot;
  fi
  echo -ne &quot;33]0;${USER_SHORT}@${HOSTNAME_SHORT}:${LOC}07&quot;
}
export PROMPT_COMMAND=promptcmd
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Have a look at PROMPT_COMMAND (<a href="http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x264.html" rel="nofollow">http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x264.html</a>)</p>
<p>This is my custom one, which updates the prompt and the terminal name.</p>
<p><code><br />
function promptcmd() {<br />
  GITBRANCH=""<br />
  GITBRANCH_SHORT=""<br />
  if GITBRANCH=$(git-symbolic-ref HEAD 2&gt; /dev/null); then<br />
    GITBRANCH_SHORT="${GITBRANCH#refs/heads/}"<br />
    GITBRANCH=" (${GITBRANCH_SHORT})"<br />
  fi<br />
  USER_SHORT=${USER:0:1}<br />
  HOSTNAME_SHORT=${HOSTNAME%%.*}<br />
  TIMESTAMP=$(date "+%a %H:%M:%S")<br />
  PS1='${debian_chroot:+($debian_chroot)}$TIMESTAMP $USER_SHORT@\h:\w$GITBRANCH\$ '<br />
  LOC=${PWD}<br />
  if [ "$GITBRANCH_SHORT" = "" ]; then<br />
    LOC=${PWD}<br />
  else<br />
    LOC=${GITBRANCH_SHORT}<br />
  fi<br />
  if [ "$LOC" = "/home/psycho" ]; then<br />
    LOC="~"<br />
  fi<br />
  echo -ne "33]0;${USER_SHORT}@${HOSTNAME_SHORT}:${LOC}07"<br />
}<br />
export PROMPT_COMMAND=promptcmd<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Hoare on Software Design by Schach-Domino-Aufgabe &#171; Spülsucht</title>
		<link>http://gnoack.wordpress.com/2008/07/31/hoare-on-software-design/#comment-2758</link>
		<dc:creator>Schach-Domino-Aufgabe &#171; Spülsucht</dc:creator>
		<pubDate>Sun, 23 Aug 2009 11:40:33 +0000</pubDate>
		<guid isPermaLink="false">http://guenthernoack.de/2008/07/31/hoare-on-software-design/#comment-2758</guid>
		<description>[...] Die Chancen stehen gut, dass man als Informatiker immer mal wieder vor ähnlich komplexen Problemen steht, die nur unter Zuhilfenahme geeigneter alternativer Anschauungen eine elegante Lösung ermöglichen. Doch wie oft erkennen wir das nicht, und verwenden Lösungen, die ungleich umständlicher sind? [...]</description>
		<content:encoded><![CDATA[<p>[...] Die Chancen stehen gut, dass man als Informatiker immer mal wieder vor ähnlich komplexen Problemen steht, die nur unter Zuhilfenahme geeigneter alternativer Anschauungen eine elegante Lösung ermöglichen. Doch wie oft erkennen wir das nicht, und verwenden Lösungen, die ungleich umständlicher sind? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Software Craftsmanship by guenthernoack</title>
		<link>http://gnoack.wordpress.com/2009/08/05/software-craftsmanship/#comment-2755</link>
		<dc:creator>guenthernoack</dc:creator>
		<pubDate>Fri, 07 Aug 2009 19:37:07 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=581#comment-2755</guid>
		<description>Hi Paul,

I highly value that you try to rethink the value system in software development. I also think that switching the role model for software developers from &#039;architect&#039; or &#039;engineer&#039; to &#039;craftsman&#039; may help. However, apart from that I&#039;m a bit afraid that your wording does not currently differentiate your movement enough from regular software development. :-/ Here&#039;s why: Consider you&#039;re talking to a manager-type of guy from company X. Company X is as far from the software craftsmanship ideal as you can get. To this manager, you pose the following questions:

* Do you [as a company] gain the trust of the businesses by delivering superior quality?
* Do you write code that is defect-free, proven, readable, understandable and malleable?
* Do your developers improve their skill-set by learning new things?
* Do you have a culture of open collaboration between developers?

It&#039;s obvious that all this is good, so probably the answer to this will be mostly &#039;Yes&#039;, even though these are basically the same statements as the ones in the URL you gave. I&#039;m not saying it *is* actually like that in company X, but from the outside, it may be hard to tell the difference. [Actually, for the manager, it may even be hard to tell the difference from the *inside*.]

In my opinion, it&#039;s maybe a bit too simple to fall into the trap of considering oneself a software craftsman too soon. How can you tell people they are not software craftsmen and should consider adopting more of these practices, when you don&#039;t define signs of *not* being a software craftsman? (I imagine endless discussions about the interpretation of the manifesto in defense of company X here.)

I also fail to see the place where the Software Craftsmanship manifesto states that it&#039;s an extension of the Agile manifesto and that you have to &quot;be Agile&quot; to be a Software Craftsman. Is that the case?

--Günther</description>
		<content:encoded><![CDATA[<p>Hi Paul,</p>
<p>I highly value that you try to rethink the value system in software development. I also think that switching the role model for software developers from &#8216;architect&#8217; or &#8216;engineer&#8217; to &#8216;craftsman&#8217; may help. However, apart from that I&#8217;m a bit afraid that your wording does not currently differentiate your movement enough from regular software development. :-/ Here&#8217;s why: Consider you&#8217;re talking to a manager-type of guy from company X. Company X is as far from the software craftsmanship ideal as you can get. To this manager, you pose the following questions:</p>
<p>* Do you [as a company] gain the trust of the businesses by delivering superior quality?<br />
* Do you write code that is defect-free, proven, readable, understandable and malleable?<br />
* Do your developers improve their skill-set by learning new things?<br />
* Do you have a culture of open collaboration between developers?</p>
<p>It&#8217;s obvious that all this is good, so probably the answer to this will be mostly &#8216;Yes&#8217;, even though these are basically the same statements as the ones in the URL you gave. I&#8217;m not saying it *is* actually like that in company X, but from the outside, it may be hard to tell the difference. [Actually, for the manager, it may even be hard to tell the difference from the *inside*.]</p>
<p>In my opinion, it&#8217;s maybe a bit too simple to fall into the trap of considering oneself a software craftsman too soon. How can you tell people they are not software craftsmen and should consider adopting more of these practices, when you don&#8217;t define signs of *not* being a software craftsman? (I imagine endless discussions about the interpretation of the manifesto in defense of company X here.)</p>
<p>I also fail to see the place where the Software Craftsmanship manifesto states that it&#8217;s an extension of the Agile manifesto and that you have to &#8220;be Agile&#8221; to be a Software Craftsman. Is that the case?</p>
<p>&#8211;Günther</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Software Craftsmanship by Paul Pagel</title>
		<link>http://gnoack.wordpress.com/2009/08/05/software-craftsmanship/#comment-2754</link>
		<dc:creator>Paul Pagel</dc:creator>
		<pubDate>Fri, 07 Aug 2009 15:31:52 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=581#comment-2754</guid>
		<description>Günther,

This has been the primary criticism for the software craftsmanship movement.  I agree that it is still romanticized and not fully fleshed out.  The ethic is another step in the right direction, but still a work in progress(http://groups.google.com/group/software_craftsmanship/web/principles-of-software-craftsmanship).  

I think the major factors of software craftsmanship are emphasizing the lifelong journey of learning, practicing, and improving your skill sets.  Craftsmanship is a great technique people have used (with varying success) to produce highly skilled artisans.</description>
		<content:encoded><![CDATA[<p>Günther,</p>
<p>This has been the primary criticism for the software craftsmanship movement.  I agree that it is still romanticized and not fully fleshed out.  The ethic is another step in the right direction, but still a work in progress(http://groups.google.com/group/software_craftsmanship/web/principles-of-software-craftsmanship).  </p>
<p>I think the major factors of software craftsmanship are emphasizing the lifelong journey of learning, practicing, and improving your skill sets.  Craftsmanship is a great technique people have used (with varying success) to produce highly skilled artisans.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Software Engineering: Come and Gone? by Akerbos</title>
		<link>http://gnoack.wordpress.com/2009/08/01/software-engineering-come-and-gone/#comment-2752</link>
		<dc:creator>Akerbos</dc:creator>
		<pubDate>Sun, 02 Aug 2009 13:51:47 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=574#comment-2752</guid>
		<description>I only skimmed the interview. If I got it right, he still thinks that metrics are important and would be, like, ideal, but has come to think that they are not necessary for a successful project. So, maybe it is just a shift from explicit metrics that can be calculated to intuitive ones that a manager with experience can quantify without drawing charts?</description>
		<content:encoded><![CDATA[<p>I only skimmed the interview. If I got it right, he still thinks that metrics are important and would be, like, ideal, but has come to think that they are not necessary for a successful project. So, maybe it is just a shift from explicit metrics that can be calculated to intuitive ones that a manager with experience can quantify without drawing charts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Photos from Munich by guenthernoack</title>
		<link>http://gnoack.wordpress.com/2009/05/23/photos-from-munich/#comment-2748</link>
		<dc:creator>guenthernoack</dc:creator>
		<pubDate>Sat, 11 Jul 2009 23:58:37 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=530#comment-2748</guid>
		<description>Die Surfer sind am Rand vom Garten, wenn man dem Eisbach folgt. Gibt es schon eine ganze Weile, und auf dem Filmfestival kürzlich kam wohl sogar ein Dokumentarfilm über sie, der die Jungs zu einer echten Surfer-Subkultur hochstilisiert. Die totalen Beach-Boys. :-)

Die Surfer sollte man leicht finden können, indem man von den Nackten aus dem Fluss flussaufwärts nachgeht.</description>
		<content:encoded><![CDATA[<p>Die Surfer sind am Rand vom Garten, wenn man dem Eisbach folgt. Gibt es schon eine ganze Weile, und auf dem Filmfestival kürzlich kam wohl sogar ein Dokumentarfilm über sie, der die Jungs zu einer echten Surfer-Subkultur hochstilisiert. Die totalen Beach-Boys. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Die Surfer sollte man leicht finden können, indem man von den Nackten aus dem Fluss flussaufwärts nachgeht.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Photos from Munich by Ralf</title>
		<link>http://gnoack.wordpress.com/2009/05/23/photos-from-munich/#comment-2746</link>
		<dc:creator>Ralf</dc:creator>
		<pubDate>Wed, 08 Jul 2009 16:00:49 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=530#comment-2746</guid>
		<description>Meine letzten Erinnerungen vom Englischen Garten waren die nackten Menschen über die ich am Isar-Ufer gestolpert bin ... an Surfer kann ich mich irgendwie nicht erinnern  :-)</description>
		<content:encoded><![CDATA[<p>Meine letzten Erinnerungen vom Englischen Garten waren die nackten Menschen über die ich am Isar-Ufer gestolpert bin &#8230; an Surfer kann ich mich irgendwie nicht erinnern  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Sack Reis fällt um by Anonymous</title>
		<link>http://gnoack.wordpress.com/2009/06/02/sack-reis-fallt-um/#comment-2734</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Wed, 10 Jun 2009 18:15:46 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=551#comment-2734</guid>
		<description>http://media.superfluence.com/reissack.jpg</description>
		<content:encoded><![CDATA[<p><a href="http://media.superfluence.com/reissack.jpg" rel="nofollow">http://media.superfluence.com/reissack.jpg</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Sack Reis fällt um by Romain</title>
		<link>http://gnoack.wordpress.com/2009/06/02/sack-reis-fallt-um/#comment-2731</link>
		<dc:creator>Romain</dc:creator>
		<pubDate>Sat, 06 Jun 2009 09:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=551#comment-2731</guid>
		<description>Coole Anspielung auf meinen Post :-) 

Ich habe allerdings nicht getwittert ^^</description>
		<content:encoded><![CDATA[<p>Coole Anspielung auf meinen Post <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  </p>
<p>Ich habe allerdings nicht getwittert ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Sack Reis fällt um by Erdferkel</title>
		<link>http://gnoack.wordpress.com/2009/06/02/sack-reis-fallt-um/#comment-2729</link>
		<dc:creator>Erdferkel</dc:creator>
		<pubDate>Wed, 03 Jun 2009 15:15:59 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=551#comment-2729</guid>
		<description>Dat beste is ja, dass tinyurl.com/reis auf die Reuters-Seite gehn tut.</description>
		<content:encoded><![CDATA[<p>Dat beste is ja, dass tinyurl.com/reis auf die Reuters-Seite gehn tut.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Puzzle: A variation of the Visitor Pattern by guenthernoack</title>
		<link>http://gnoack.wordpress.com/2009/05/15/a-return-value-variation-of-the-visitor-pattern/#comment-2721</link>
		<dc:creator>guenthernoack</dc:creator>
		<pubDate>Thu, 28 May 2009 00:06:39 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=513#comment-2721</guid>
		<description>The solution goes something like this: Change the accept and visit methods to return a value (accept just passes through the visit method&#039;s results). This is very simple in a dynamically typed language. In ruby, even the above accept code will do (a method&#039;s last expression&#039;s value is returned).

In a language like Java (with static typing and a type system with generics) this may look like this:

[sourcecode language=&#039;java&#039;]
public  T accept(Visitor visitor) {
  return visitor.visit(this);
}
[/sourcecode]

A typical expression visitor might specialize T as a number type. This way, the evaluation method could for example be implemented like this:

[sourcecode language=&#039;java&#039;]
public Integer visit(AddExpression expr) {
  return expr.leftSubExpression().accept(this) + expr.rightSubExpression.accept(this);
}
[/sourcecode]

(This code is untested.) To be honest, it&#039;s a bit sad that Java only allows to specialize a generic type using class types, not atomic types like int. I hope that helped. :)

Best regards,
Günther</description>
		<content:encoded><![CDATA[<p>The solution goes something like this: Change the accept and visit methods to return a value (accept just passes through the visit method&#8217;s results). This is very simple in a dynamically typed language. In ruby, even the above accept code will do (a method&#8217;s last expression&#8217;s value is returned).</p>
<p>In a language like Java (with static typing and a type system with generics) this may look like this:</p>
<pre class="brush: java;">
public  T accept(Visitor visitor) {
  return visitor.visit(this);
}
</pre>
<p>A typical expression visitor might specialize T as a number type. This way, the evaluation method could for example be implemented like this:</p>
<pre class="brush: java;">
public Integer visit(AddExpression expr) {
  return expr.leftSubExpression().accept(this) + expr.rightSubExpression.accept(this);
}
</pre>
<p>(This code is untested.) To be honest, it&#8217;s a bit sad that Java only allows to specialize a generic type using class types, not atomic types like int. I hope that helped. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Best regards,<br />
Günther</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Puzzle: A variation of the Visitor Pattern by Eyal</title>
		<link>http://gnoack.wordpress.com/2009/05/15/a-return-value-variation-of-the-visitor-pattern/#comment-2720</link>
		<dc:creator>Eyal</dc:creator>
		<pubDate>Wed, 27 May 2009 06:12:39 +0000</pubDate>
		<guid isPermaLink="false">http://gnoack.wordpress.com/?p=513#comment-2720</guid>
		<description>I&#039;m currently stuck with a problem at work trying to implement a visitor on an expression tree and then realizing I need to use a stack exactly as you describe. 
Since I didn&#039;t like this solution I started looking around to see if there&#039;s anything more elegant and bumped into your post. So.. Can you share the solution, Or am I going to need to continue looking around?? :)

thanks</description>
		<content:encoded><![CDATA[<p>I&#8217;m currently stuck with a problem at work trying to implement a visitor on an expression tree and then realizing I need to use a stack exactly as you describe.<br />
Since I didn&#8217;t like this solution I started looking around to see if there&#8217;s anything more elegant and bumped into your post. So.. Can you share the solution, Or am I going to need to continue looking around?? <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Observer pattern revisited using Java 5 generics by guenthernoack</title>
		<link>http://gnoack.wordpress.com/2008/02/26/observer-pattern-revisited-using-java-5-generics/#comment-2703</link>
		<dc:creator>guenthernoack</dc:creator>
		<pubDate>Fri, 22 May 2009 21:32:30 +0000</pubDate>
		<guid isPermaLink="false">http://guenthernoack.de/2008/02/26/observer-pattern-revisited-using-java-5-generics/#comment-2703</guid>
		<description>Yes, it just bypasses the &lt;code&gt;instanceof&lt;/code&gt; and the cast. It&#039;s also true that an observer can only observe one kind of class (plus subclasses) now. I also identified this in the article itself (the first bullet point), but the language is probably a bit too technical there.

When you want to make you object both a subclass of &lt;code&gt;Observer&lt;A&gt;&lt;/code&gt; and &lt;code&gt;Observer&lt;B&gt;&lt;/code&gt; (A and B being unrelated classes), it&#039;s not possible in Java as far as I know. (This has to do with byte code compatibility to earlier versions where generics were not possible yet.) However, if the object in the Observer role registers itself at the observable object, it may be possible to use inner classes that implement &lt;code&gt;Observer&lt;A&gt;&lt;/code&gt; and &lt;code&gt;Observer&lt;B&gt;&lt;/code&gt;. (The inner classes&#039; instances can only be created by an instance of the surrounding class and can also access private methods and fields of that object.)

Unfortunately, avoiding &lt;code&gt;instanceof&lt;/code&gt; is usually not straightforward. Here&#039;s the bird view on that issue: When implementing some functionality in a method, you can usually choose into which class that method belongs. (For the other related objects, it may be unavoidable to use &lt;code&gt;instanceof&lt;/code&gt;.) A simple heuristic would be to identify of which of used argument objects (also the receiver object [1]) the most instance variables need to be used (or simply &quot;which is the most important object in this piece of code?&quot;). Another concern is that you usually want to be able to use polymorphism (so that subclasses can override methods), but it only works on the receiver argument. To choose, which of the used objects is the receiver, there needs to be some kind of imbalance between all the argument objects. However, in some cases, the imbalance is not always given and all argument objects are equally important. If that happens, I usually try the following:

 (1) Building an additional layer of abstraction around one or more of these arguments, so that they are used in a less direct way. As a result, an imbalance can be established, thereby marking the &quot;most important&quot; object&#039;s class as the class, where the method fits into best. Another result of an additional layer of abstraction is often that the use of &lt;code&gt;instanceof&lt;/code&gt; &quot;moves into the implementation of that layer&quot;. When applying this technique recursively, it ultimately usually disappears. :)
 (2) If this doesn&#039;t work, you need something called &quot;multiple dispatch&quot;. This means that the question, which method is to be executed when a call is made, is answered not only using the type of the receiver object, but instead using the types of *all objects* handed as arguments. (Note that you can directly use this to avoid &lt;code&gt;instanceof&lt;/code&gt;s! :-)) Java doesn&#039;t support this as a language feature, but the visitor pattern does exactly that. (I just recently wrote a blog entry about it, where I talk about that pattern, but the best resource on the topic probably is the classic &quot;Gang of Four&quot; design patterns book. http://home.earthlink.net/~huston2/dp/visitor.html looks good, too. Be careful about the sources you use here, because many people see the visitor pattern very much from a &quot;walking tree structures&quot; angle, which is a very related idea that can be done easily using it, but which leads many people into the mistaken belief that this is all the pattern does.)

To sum up, I have made the experience that (1) &lt;code&gt;instanceof&lt;/code&gt; usage often disappears by adding more layers of abstraction and (2) if this makes difficulties, the visitor pattern can be used as last escape. :-)

I&#039;m afraid this may have been even more confusing than the previous comment I wrote. I hope it still helps. In doubt, don&#039;t trust me but trust the Gang of Four book. :-) Also don&#039;t take patterns too dogmatic. It&#039;s not so important to use the exact same names as in the books, but if you know a pattern and you have thought about its advantages and disadvantages, it often helps to explore the design space faster or in a more efficient manner. If you have some new insights, I&#039;d be happy to hear about it. :-)

[1] Small example for terminology: In the following code snippet, &quot;taxi&quot; is the receiver object, &quot;memphis&quot; and &quot;driver&quot; are arguments to the method:

taxi.drive(driver, memphis);

When considering the order of these arguments, it makes sense to see all three &quot;taxi&quot;, &quot;driver&quot; and &quot;memphis&quot; as plain arguments first and later decide which of the classes Car, Person and City is imporant enough to host the &quot;drive&quot; method.</description>
		<content:encoded><![CDATA[<p>Yes, it just bypasses the <code>instanceof</code> and the cast. It&#8217;s also true that an observer can only observe one kind of class (plus subclasses) now. I also identified this in the article itself (the first bullet point), but the language is probably a bit too technical there.</p>
<p>When you want to make you object both a subclass of <code>Observer&lt;A&gt;</code> and <code>Observer&lt;B&gt;</code> (A and B being unrelated classes), it&#8217;s not possible in Java as far as I know. (This has to do with byte code compatibility to earlier versions where generics were not possible yet.) However, if the object in the Observer role registers itself at the observable object, it may be possible to use inner classes that implement <code>Observer&lt;A&gt;</code> and <code>Observer&lt;B&gt;</code>. (The inner classes&#8217; instances can only be created by an instance of the surrounding class and can also access private methods and fields of that object.)</p>
<p>Unfortunately, avoiding <code>instanceof</code> is usually not straightforward. Here&#8217;s the bird view on that issue: When implementing some functionality in a method, you can usually choose into which class that method belongs. (For the other related objects, it may be unavoidable to use <code>instanceof</code>.) A simple heuristic would be to identify of which of used argument objects (also the receiver object [1]) the most instance variables need to be used (or simply &#8220;which is the most important object in this piece of code?&#8221;). Another concern is that you usually want to be able to use polymorphism (so that subclasses can override methods), but it only works on the receiver argument. To choose, which of the used objects is the receiver, there needs to be some kind of imbalance between all the argument objects. However, in some cases, the imbalance is not always given and all argument objects are equally important. If that happens, I usually try the following:</p>
<p> (1) Building an additional layer of abstraction around one or more of these arguments, so that they are used in a less direct way. As a result, an imbalance can be established, thereby marking the &#8220;most important&#8221; object&#8217;s class as the class, where the method fits into best. Another result of an additional layer of abstraction is often that the use of <code>instanceof</code> &#8220;moves into the implementation of that layer&#8221;. When applying this technique recursively, it ultimately usually disappears. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
 (2) If this doesn&#8217;t work, you need something called &#8220;multiple dispatch&#8221;. This means that the question, which method is to be executed when a call is made, is answered not only using the type of the receiver object, but instead using the types of *all objects* handed as arguments. (Note that you can directly use this to avoid <code>instanceof</code>s! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) Java doesn&#8217;t support this as a language feature, but the visitor pattern does exactly that. (I just recently wrote a blog entry about it, where I talk about that pattern, but the best resource on the topic probably is the classic &#8220;Gang of Four&#8221; design patterns book. <a href="http://home.earthlink.net/~huston2/dp/visitor.html" rel="nofollow">http://home.earthlink.net/~huston2/dp/visitor.html</a> looks good, too. Be careful about the sources you use here, because many people see the visitor pattern very much from a &#8220;walking tree structures&#8221; angle, which is a very related idea that can be done easily using it, but which leads many people into the mistaken belief that this is all the pattern does.)</p>
<p>To sum up, I have made the experience that (1) <code>instanceof</code> usage often disappears by adding more layers of abstraction and (2) if this makes difficulties, the visitor pattern can be used as last escape. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I&#8217;m afraid this may have been even more confusing than the previous comment I wrote. I hope it still helps. In doubt, don&#8217;t trust me but trust the Gang of Four book. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Also don&#8217;t take patterns too dogmatic. It&#8217;s not so important to use the exact same names as in the books, but if you know a pattern and you have thought about its advantages and disadvantages, it often helps to explore the design space faster or in a more efficient manner. If you have some new insights, I&#8217;d be happy to hear about it. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>[1] Small example for terminology: In the following code snippet, &#8220;taxi&#8221; is the receiver object, &#8220;memphis&#8221; and &#8220;driver&#8221; are arguments to the method:</p>
<p>taxi.drive(driver, memphis);</p>
<p>When considering the order of these arguments, it makes sense to see all three &#8220;taxi&#8221;, &#8220;driver&#8221; and &#8220;memphis&#8221; as plain arguments first and later decide which of the classes Car, Person and City is imporant enough to host the &#8220;drive&#8221; method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Observer pattern revisited using Java 5 generics by Farzanegan</title>
		<link>http://gnoack.wordpress.com/2008/02/26/observer-pattern-revisited-using-java-5-generics/#comment-2701</link>
		<dc:creator>Farzanegan</dc:creator>
		<pubDate>Wed, 20 May 2009 19:22:50 +0000</pubDate>
		<guid isPermaLink="false">http://guenthernoack.de/2008/02/26/observer-pattern-revisited-using-java-5-generics/#comment-2701</guid>
		<description>So what you&#039;re doing really just bypasses the &#039;instanceof/cast&#039;.  There&#039;s still got the same underlying problem of only being able to observe one &#039;class&#039; of object for an observable.  I assume what you were saying in the 2nd part was that I could compose an object which could listen to the different classes from different producers.

I&#039;m playing around with an application that listens to a controller- the controller needs to send messages, which I thought would be straightforward.  But each message could have different components (from states to actual data), which mean different objects.  So I guess I&#039;m stuck with the &#039;instanceof&#039; model.   I guess an improvement would be if Observer could have method signatures with the desired class instead of passing &#039;Object&#039;.  That&#039;s an old beaten horse, since Observer/Observable have been around since 1.0.</description>
		<content:encoded><![CDATA[<p>So what you&#8217;re doing really just bypasses the &#8216;instanceof/cast&#8217;.  There&#8217;s still got the same underlying problem of only being able to observe one &#8216;class&#8217; of object for an observable.  I assume what you were saying in the 2nd part was that I could compose an object which could listen to the different classes from different producers.</p>
<p>I&#8217;m playing around with an application that listens to a controller- the controller needs to send messages, which I thought would be straightforward.  But each message could have different components (from states to actual data), which mean different objects.  So I guess I&#8217;m stuck with the &#8216;instanceof&#8217; model.   I guess an improvement would be if Observer could have method signatures with the desired class instead of passing &#8216;Object&#8217;.  That&#8217;s an old beaten horse, since Observer/Observable have been around since 1.0.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Observer pattern revisited using Java 5 generics by guenthernoack</title>
		<link>http://gnoack.wordpress.com/2008/02/26/observer-pattern-revisited-using-java-5-generics/#comment-2700</link>
		<dc:creator>guenthernoack</dc:creator>
		<pubDate>Wed, 20 May 2009 19:06:31 +0000</pubDate>
		<guid isPermaLink="false">http://guenthernoack.de/2008/02/26/observer-pattern-revisited-using-java-5-generics/#comment-2700</guid>
		<description>There are actually two answers to that question. The first is concerning the &quot;instanceof&quot; that I also refer to in the article (this could have been much more explicit though):

1. When just using the &quot;Standard&quot; Observer class that you can find in the Java class library, observers implement the interface method &quot;void update(Observable o, Object arg)&quot;. Even though a program may be designed so that a *specific* implementation only gets notifications from a *specific* Observable implementation, the type of the argument given in &quot;update&quot; is still &quot;Observable&quot;. Thus, a cast is needed to do something more specific, therefore most programmers would use instanceof to check whether that cast will work first. Using generics, the correct type is given directly to the update method and both the cast and this instanceof aren&#039;t needed any more.

2. The second part of the answer is concerned with the case that the observers observe a larger class hierarchy and thus more actual types can be passed to update(). (You won&#039;t like this answer. ;-)) I believe this problem is completely independent of the observer pattern in that the question is actually &quot;what to do when different things must be done for different subclasses&quot;. The basic answer is: Starting from a switch statement or multiple if-constructs, move the code for the different cases into the relevant class hierarchy and use Polymorphism instead.

There are people who say that instanceof is generally to be avoided, and when working in an Object Oriented context, it probably makes sense. Here&#039;s a bigger discussion on that topic:
http://c2.com/cgi/wiki?InstanceofInConditionals
http://c2.com/cgi/wiki?ReplaceConditionalWithPolymorphism

I hope I could help you a bit. If not, feel free to ask. :)</description>
		<content:encoded><![CDATA[<p>There are actually two answers to that question. The first is concerning the &#8220;instanceof&#8221; that I also refer to in the article (this could have been much more explicit though):</p>
<p>1. When just using the &#8220;Standard&#8221; Observer class that you can find in the Java class library, observers implement the interface method &#8220;void update(Observable o, Object arg)&#8221;. Even though a program may be designed so that a *specific* implementation only gets notifications from a *specific* Observable implementation, the type of the argument given in &#8220;update&#8221; is still &#8220;Observable&#8221;. Thus, a cast is needed to do something more specific, therefore most programmers would use instanceof to check whether that cast will work first. Using generics, the correct type is given directly to the update method and both the cast and this instanceof aren&#8217;t needed any more.</p>
<p>2. The second part of the answer is concerned with the case that the observers observe a larger class hierarchy and thus more actual types can be passed to update(). (You won&#8217;t like this answer. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) I believe this problem is completely independent of the observer pattern in that the question is actually &#8220;what to do when different things must be done for different subclasses&#8221;. The basic answer is: Starting from a switch statement or multiple if-constructs, move the code for the different cases into the relevant class hierarchy and use Polymorphism instead.</p>
<p>There are people who say that instanceof is generally to be avoided, and when working in an Object Oriented context, it probably makes sense. Here&#8217;s a bigger discussion on that topic:<br />
<a href="http://c2.com/cgi/wiki?InstanceofInConditionals" rel="nofollow">http://c2.com/cgi/wiki?InstanceofInConditionals</a><br />
<a href="http://c2.com/cgi/wiki?ReplaceConditionalWithPolymorphism" rel="nofollow">http://c2.com/cgi/wiki?ReplaceConditionalWithPolymorphism</a></p>
<p>I hope I could help you a bit. If not, feel free to ask. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Observer pattern revisited using Java 5 generics by Farzanegan</title>
		<link>http://gnoack.wordpress.com/2008/02/26/observer-pattern-revisited-using-java-5-generics/#comment-2699</link>
		<dc:creator>Farzanegan</dc:creator>
		<pubDate>Wed, 20 May 2009 03:18:17 +0000</pubDate>
		<guid isPermaLink="false">http://guenthernoack.de/2008/02/26/observer-pattern-revisited-using-java-5-generics/#comment-2699</guid>
		<description>I like the concept, but I&#039;m having trouble grasping how you&#039;re really going to avoid the equivalent of a bunch of &#039;instance-ofs&#039; when you&#039;re processing your observed events (assuming that Unemployed is also observing other producers such as &#039;RecruiterSeminar&#039;).</description>
		<content:encoded><![CDATA[<p>I like the concept, but I&#8217;m having trouble grasping how you&#8217;re really going to avoid the equivalent of a bunch of &#8216;instance-ofs&#8217; when you&#8217;re processing your observed events (assuming that Unemployed is also observing other producers such as &#8216;RecruiterSeminar&#8217;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on BBQ Gnulpf by Mascota &#171; BBQ Uisrael 09</title>
		<link>http://gnoack.wordpress.com/2008/06/19/bbqgnulpf/#comment-2698</link>
		<dc:creator>Mascota &#171; BBQ Uisrael 09</dc:creator>
		<pubDate>Tue, 19 May 2009 21:44:59 +0000</pubDate>
		<guid isPermaLink="false">http://guenthernoack.de/2008/06/19/bbqgnulpf/#comment-2698</guid>
		<description>[...] el dibu para que sea sorpresa, aunque si estan viendo esto es porque ya tienen la invitación (via GNOACK) igual propongo que para twitter las comunicaciones sean [...]</description>
		<content:encoded><![CDATA[<p>[...] el dibu para que sea sorpresa, aunque si estan viendo esto es porque ya tienen la invitación (via GNOACK) igual propongo que para twitter las comunicaciones sean [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>
