<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pathfinder Development &#187; Design Patterns</title>
	<atom:link href="http://www.pathf.com/blogs/tag/design-patterns/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pathf.com/blogs</link>
	<description>Running commentary about agile development, user experience design and Ajax.</description>
	<lastBuildDate>Tue, 16 Mar 2010 13:42:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Bean of the Devil: Tally-Ho CMS</title>
		<link>http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/</link>
		<comments>http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 19:07:18 +0000</pubDate>
		<dc:creator>Dietrich Kappe</dc:creator>
				<category><![CDATA[Custom Application Development]]></category>
		<category><![CDATA[Rich Internet Apps]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Software Development Best Practices]]></category>
		<category><![CDATA[Technologies and Platforms]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[OOAD]]></category>
		<category><![CDATA[OOP]]></category>
		<category><![CDATA[Structured Design]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1658</guid>
		<description><![CDATA[Last time we came this way we looked at the misuse of a getter in the java.io.File. Not that it was wrong to have a getter in File, just that it led to misuse of that information in a UI control to determine what file encoding needed to be used to store the model.
This time [...]<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/">Bean of the Devil: Tally-Ho CMS</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/' rel='bookmark' title='Permanent Link: Bean of the Devil: Arguing the Affirmative'>Bean of the Devil: Arguing the Affirmative</a></li><li><a href='http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/' rel='bookmark' title='Permanent Link: Bean of the Devil: Why Getters, Setters and Such are Evil'>Bean of the Devil: Why Getters, Setters and Such are Evil</a></li><li><a href='http://www.pathf.com/blogs/2008/08/many-varied-components-or-multi-variable-complexity-or-mainly-vanilla-coding/' rel='bookmark' title='Permanent Link: Many Varied Components, or&#8230; Multi Variable Complexity, or&#8230; Mainly Vanilla Coding'>Many Varied Components, or&#8230; Multi Variable Complexity, or&#8230; Mainly Vanilla Coding</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.pathf.com/blogs/wp-content/uploads/2009/02/bean.jpg" alt="bean" title="bean" width="100" height="100" class="alignnone size-full wp-image-1409" style="float:right;padding:10px" />Last time we came this way <a href="http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/">we looked at the misuse of a getter in the <code>java.io.File</code></a>. Not that it was wrong to have a getter in <code>File</code>, just that it led to misuse of that information in a UI control to determine what file encoding needed to be used to store the model.</p>
<p>This time we are looking at the <a href="https://tally-ho.dev.java.net/" target="_blank">Tally-ho CMS project</a>. This is perhaps a more pernicious example of the shortcomings of getters and setters. We're not having to remember rules about changing state here (that's for an upcoming post), but we are exposing the implementation details and thus repeating code and making our application harder to change.</p>
<p>There are many places where <code>ArticleBean</code> is unpacked in the application. Here are just two examples.<br />
<span id="more-1658"></span><br />
First, from <code>net.spatula.tally_ho.ui.article.ArticleHome</code> we have</p>
<pre class="java5">&nbsp;
&nbsp;
        <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #993333;">void</span> populateItem<span style="color: #66cc66;">&#40;</span>ListItem item<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            ArticleBean article = <span style="color: #66cc66;">&#40;</span>ArticleBean<span style="color: #66cc66;">&#41;</span>item.<span style="color: #006600;">getModelObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
            Fragment headlineFragment = <span style="color: #000000; font-weight: bold;">new</span> Fragment<span style="color: #66cc66;">&#40;</span>fragmentName, <span style="color: #ff0000;">&quot;headlineFrag&quot;</span><span style="color: #66cc66;">&#41;</span>;
            BookmarkablePageLink articleLink = <span style="color: #000000; font-weight: bold;">new</span> BookmarkablePageLink<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;articleLink&quot;</span>, ArticleRead.<span style="color: #000000; font-weight: bold;">class</span>, <span style="color: #000000; font-weight: bold;">new</span> PageParameters<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;0=&quot;</span>+<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html"><span style="color: #aaaadd; font-weight: bold;">String</span></a>.<span style="color: #006600;">valueOf</span><span style="color: #66cc66;">&#40;</span>article.<span style="color: #006600;">getId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
            articleLink.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Label.html"><span style="color: #aaaadd; font-weight: bold;">Label</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;title&quot;</span>, article.<span style="color: #006600;">getHeadline</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
            headlineFragment.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>articleLink<span style="color: #66cc66;">&#41;</span>;
            headlineFragment.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Label.html"><span style="color: #aaaadd; font-weight: bold;">Label</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;author&quot;</span>, article.<span style="color: #006600;">getCreator</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getUsername</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
            headlineFragment.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Label.html"><span style="color: #aaaadd; font-weight: bold;">Label</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;date&quot;</span>, article.<span style="color: #006600;">getCreateDate</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
            headlineFragment.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Label.html"><span style="color: #aaaadd; font-weight: bold;">Label</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;summary&quot;</span>, article.<span style="color: #006600;">getSummary</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
            item.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>headlineFragment<span style="color: #66cc66;">&#41;</span>;
&nbsp;
        <span style="color: #66cc66;">&#125;</span>
      <span style="color: #66cc66;">&#125;</span></pre>
<p>Note that we yank the state out of the article bean and its fields. And from <code>net.spatula.tally_ho.ui.admin.ApproveArticles</code> we have</p>
<pre class="java5">&nbsp;
            @<a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Override.html"><span style="color: #aaaadd; font-weight: bold;">Override</span></a>
            <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #993333;">void</span> populateItem<span style="color: #66cc66;">&#40;</span>ListItem item<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>!<span style="color: #66cc66;">&#40;</span>item.<span style="color: #006600;">getModelObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #000000; font-weight: bold;">instanceof</span> ArticleBean<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                    <span style="color: #000000; font-weight: bold;">return</span>;
                <span style="color: #66cc66;">&#125;</span>
                <span style="color: #000000; font-weight: bold;">final</span> ArticleBean article = <span style="color: #66cc66;">&#40;</span>ArticleBean<span style="color: #66cc66;">&#41;</span> item.<span style="color: #006600;">getModelObject</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
                item.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Label.html"><span style="color: #aaaadd; font-weight: bold;">Label</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;alias&quot;</span>, article.<span style="color: #006600;">getCreator</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">getUsername</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
                item.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Label.html"><span style="color: #aaaadd; font-weight: bold;">Label</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;title&quot;</span>, article.<span style="color: #006600;">getHeadline</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
                <span style="color: #000000; font-weight: bold;">final</span> ModalWindow articleWindow = <span style="color: #000000; font-weight: bold;">new</span> ModalWindow<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;articleWindow&quot;</span><span style="color: #66cc66;">&#41;</span>;
                articleWindow.<span style="color: #006600;">setTitle</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;Article Display Window&quot;</span><span style="color: #66cc66;">&#41;</span>;
                articleWindow.<span style="color: #006600;">setCookieName</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;articleWindow&quot;</span><span style="color: #66cc66;">&#41;</span>;
                articleWindow.<span style="color: #006600;">setCookieName</span><span style="color: #66cc66;">&#40;</span><span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span>;
                articleWindow.<span style="color: #006600;">setUseInitialHeight</span><span style="color: #66cc66;">&#40;</span><span style="color: #b13366;">false</span><span style="color: #66cc66;">&#41;</span>;
                articleWindow.<span style="color: #006600;">setResizable</span><span style="color: #66cc66;">&#40;</span><span style="color: #b13366;">true</span><span style="color: #66cc66;">&#41;</span>;
                articleWindow.<span style="color: #006600;">setCssClassName</span><span style="color: #66cc66;">&#40;</span>ModalWindow.<span style="color: #006600;">CSS_CLASS_GRAY</span><span style="color: #66cc66;">&#41;</span>;
                articleWindow.<span style="color: #006600;">setContent</span><span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> ArticleDisplayPanel<span style="color: #66cc66;">&#40;</span>articleWindow.<span style="color: #006600;">getContentId</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, item.<span style="color: #006600;">getModel</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
                item.<span style="color: #006600;">add</span><span style="color: #66cc66;">&#40;</span>articleWindow<span style="color: #66cc66;">&#41;</span>;
&nbsp;</pre>
<p>Again, we unpack the <code>ArticleBean</code> and jam its contents into something else. Multiply this by a dozen and you see the problem. Any change to the implementation of <code>ArticleBean</code> and we have to grovel around several code files and make changes to this code. At the very least it violate the DRY principle, at the very worst it puts us into <a href="http://www.amazon.com/Structured-Design-Fundamentals-Discipline-Computer/dp/0138544719" target="_blank">Structured Design</a> territory and the terrifying solutions to the awful problems it considers.</p>
<p>What are our options? This is a system boundary, i.e. we are going from model to UI, so we will have to expose the implementation at some point. Well, we could put this logic in <code>ArticleBean</code> and have it take a parameter to be modified. But that would put UI logic into the model. Not so good.</p>
<p>A better solution here would be a helper object that consolidates all of the logic in one place. Imagine a change to the implementation of <code>ArticleBean</code> (maybe we can stop calling it a bean, eh?), where we go to a variable state mode, i.e. a map of key-value pairs. Now we can change our helper object without having to change our two dozen or so collaborations with the <code>ArticleBean</code>.</p>
<p>OK, tag, your it. Disagree? I want to hear your arguments. Agree and seen similar things? I want to hear about that too.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/">Bean of the Devil: Tally-Ho CMS</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/' rel='bookmark' title='Permanent Link: Bean of the Devil: Arguing the Affirmative'>Bean of the Devil: Arguing the Affirmative</a></li><li><a href='http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/' rel='bookmark' title='Permanent Link: Bean of the Devil: Why Getters, Setters and Such are Evil'>Bean of the Devil: Why Getters, Setters and Such are Evil</a></li><li><a href='http://www.pathf.com/blogs/2008/08/many-varied-components-or-multi-variable-complexity-or-mainly-vanilla-coding/' rel='bookmark' title='Permanent Link: Many Varied Components, or&#8230; Multi Variable Complexity, or&#8230; Mainly Vanilla Coding'>Many Varied Components, or&#8230; Multi Variable Complexity, or&#8230; Mainly Vanilla Coding</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bean of the Devil: Arguing the Affirmative</title>
		<link>http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/</link>
		<comments>http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 21:29:22 +0000</pubDate>
		<dc:creator>Dietrich Kappe</dc:creator>
				<category><![CDATA[Custom Application Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet Apps]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Software Development Best Practices]]></category>
		<category><![CDATA[Technologies and Platforms]]></category>
		<category><![CDATA[Antipatterns]]></category>
		<category><![CDATA[Beans]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1412</guid>
		<description><![CDATA[I've gotten lots of feedback, much of it asking "what's the alternative?" to using beans and getters and setters. I'll make a deal with my skeptical readers. I'll argue the negative, with examples, if they argue the affirmative. In other words, you show me some places where you can't get around using getters and setters [...]<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/">Bean of the Devil: Arguing the Affirmative</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/' rel='bookmark' title='Permanent Link: Bean of the Devil: Why Getters, Setters and Such are Evil'>Bean of the Devil: Why Getters, Setters and Such are Evil</a></li><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/' rel='bookmark' title='Permanent Link: Bean of the Devil: Tally-Ho CMS'>Bean of the Devil: Tally-Ho CMS</a></li><li><a href='http://www.pathf.com/blogs/2008/05/ruby-internals/' rel='bookmark' title='Permanent Link: Ruby Internals: Overriding Object.require() to watch files as they are loaded'>Ruby Internals: Overriding Object.require() to watch files as they are loaded</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pathf.com/blogs/wp-content/uploads/2009/02/bean.jpg"><img class="alignnone size-full wp-image-1409" style="float:right; padding:10px" title="bean" src="http://www.pathf.com/blogs/wp-content/uploads/2009/02/bean.jpg" alt="" width="100" height="100" /></a>I've gotten lots of feedback, much of it asking "what's the alternative?" to using beans and getters and setters. I'll make a deal with my skeptical readers. I'll argue the negative, with examples, if they argue the affirmative. In other words, you show me some places where you can't get around using getters and setters and I'll show you all sorts of places for the next few weeks, from real open source projects, where people have screwed the pooch with unnecessary getters and setters.</p>
<p><span id="more-1412"></span></p>
<p>For my first trick, I give you <code>JChemPaint.java</code> from the JChemPaint project:</p>
<pre class="java5">  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>file.<span style="color: #006600;">getName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">toLowerCase</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">endsWith</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;.cml&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
  <span style="color: #66cc66;">&#123;</span>
    FileUtils.<span style="color: #006600;">saveModeltoCMLfile</span><span style="color: #66cc66;">&#40;</span>file, getCurrentModel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span>
  <span style="color: #b1b100;">else</span>
  <span style="color: #66cc66;">&#123;</span>
    FileUtils.<span style="color: #006600;">saveModeltoMDLMolfile</span><span style="color: #66cc66;">&#40;</span>file, getCurrentModel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
  <span style="color: #66cc66;">&#125;</span></pre>
<p>This little beauty sits inside a Swing Action's <code>actionPerformed()</code> method. Sweet. There's similar logic for loading and renaming files as well. The point is that this logic shouldn't be sitting in the UI layer at all. It should probably reside in <code>FileUtils</code>. If you want to go a touch farther, you could have a working document model that contains the file name, whether the model has been modified without being saved (a "dirty" flag), etc. This would wrap the base model and intercept calls that might necessitate updating the dirty flag.</p>
<p>There are other ways to go here, but I think you can see how the tempting <code>getName()</code> led to introduction of file name extension logic here.</p>
<p>OK, tag, you're it. I look forward to seeing cases where getters and setters are absolutely necessary.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/">Bean of the Devil: Arguing the Affirmative</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/' rel='bookmark' title='Permanent Link: Bean of the Devil: Why Getters, Setters and Such are Evil'>Bean of the Devil: Why Getters, Setters and Such are Evil</a></li><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/' rel='bookmark' title='Permanent Link: Bean of the Devil: Tally-Ho CMS'>Bean of the Devil: Tally-Ho CMS</a></li><li><a href='http://www.pathf.com/blogs/2008/05/ruby-internals/' rel='bookmark' title='Permanent Link: Ruby Internals: Overriding Object.require() to watch files as they are loaded'>Ruby Internals: Overriding Object.require() to watch files as they are loaded</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Bean of the Devil: Why Getters, Setters and Such are Evil</title>
		<link>http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/</link>
		<comments>http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 01:03:56 +0000</pubDate>
		<dc:creator>Dietrich Kappe</dc:creator>
				<category><![CDATA[Custom Application Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet Apps]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Software Development Best Practices]]></category>
		<category><![CDATA[Technologies and Platforms]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Object-Oriented]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1408</guid>
		<description><![CDATA[I felt like I'd already gotten this rant out of my system, but every time I come across the object oriented wreckage that the Java Bean and it's decendents have wrought, I get all heated up. The problem is, simply stated, that the getters and setters that get used for things like system boundaries -- [...]<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/">Bean of the Devil: Why Getters, Setters and Such are Evil</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/' rel='bookmark' title='Permanent Link: Bean of the Devil: Arguing the Affirmative'>Bean of the Devil: Arguing the Affirmative</a></li><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/' rel='bookmark' title='Permanent Link: Bean of the Devil: Tally-Ho CMS'>Bean of the Devil: Tally-Ho CMS</a></li><li><a href='http://www.pathf.com/blogs/2007/09/scriptaculous-a/' rel='bookmark' title='Permanent Link: Scriptaculous and Why &#8216;extends&#8217; is Evil'>Scriptaculous and Why &#8216;extends&#8217; is Evil</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pathf.com/blogs/wp-content/uploads/2009/02/bean.jpg"><img class="alignnone size-full wp-image-1409" style="float:right; padding:10px" title="bean" src="http://www.pathf.com/blogs/wp-content/uploads/2009/02/bean.jpg" alt="" width="100" height="100" /></a>I felt like I'd already gotten this rant out of my system, but every time I come across the object oriented wreckage that the Java Bean and it's decendents have wrought, I get all heated up. The problem is, simply stated, that the getters and setters that get used for things like system boundaries -- Hibernate for persistence, Spring for dependency injection, Java Beans for UI components -- end up being misused for things that break basic OO principles.</p>
<p><span id="more-1408"></span></p>
<p>How do these pernicious little getters and setters undermine OO? Let me count the ways.</p>
<ol>
<li>Encapsulation: the detailed implementation of an object is hidden from the rest of the system. Yes, yes, 99.99999% of all getters and setters are just fronting a private field and that's bad enough, but this is more about the getters, pulling data out of the object and doing things with it outside the object. They leak out, bit by bit, until you repeat yourself all over the place with slightly different manipulations of the data. Before you know it, you are looking at a siloed procedural applications that spurred the invention of OO in the first place.</li>
<li>Polymorphism: one type can substituted for another. If your implementation is out there flapping in the breeze, it's hard to swap types. Even if you do, the application of polymorphism is usually pretty weak. Leaking implementation into the collaborating classes really ties your hands.</li>
<li>High Cohesion: responsibilities of an object are strongly related and focused. If you pull information out of objects and deal with it in the collaborating objects, the cohesion is going to be progressively more diffuse.</li>
<li>Low Coupling: low dependencies between classes, low impact of changes in a class on other classes and high reuse potential. This is a killer. Again, you have your implementation info spread all over the countryside like in a procedural application. You change the implementation and you are in for a mega refactoring.</li>
<li>Information Expert: the responsibility goes to the object with all the relevant information. When you leak data into the collaborating classes, how can you identify the information expert?</li>
</ol>
<p>There's more, of course, but the worst part is that in a system with getters and setters, the rot gets worse the longer the system is under development. A little enhancement can be done so easily by pulling an integer here, a string there and doing a little dance in a method without arranging the collaboration of necessary classes. You need to refactor and refactor to stem the tide. It is a problem of your own making that costs you time and budget.</p>
<p>So, think twice before you expose everything with getters and setters. I would argue that they be the exception and not the rule. A rare sprinking to season the system boundaries.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/">Bean of the Devil: Why Getters, Setters and Such are Evil</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-arguing-the-affirmative/' rel='bookmark' title='Permanent Link: Bean of the Devil: Arguing the Affirmative'>Bean of the Devil: Arguing the Affirmative</a></li><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/' rel='bookmark' title='Permanent Link: Bean of the Devil: Tally-Ho CMS'>Bean of the Devil: Tally-Ho CMS</a></li><li><a href='http://www.pathf.com/blogs/2007/09/scriptaculous-a/' rel='bookmark' title='Permanent Link: Scriptaculous and Why &#8216;extends&#8217; is Evil'>Scriptaculous and Why &#8216;extends&#8217; is Evil</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2009/02/bean-of-the-devil-why-getters-setters-and-such-are-evil/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>PureMVC, Spanning the Platform Spectrum?</title>
		<link>http://www.pathf.com/blogs/2008/12/puremvc-spanning-the-platform-spectrum/</link>
		<comments>http://www.pathf.com/blogs/2008/12/puremvc-spanning-the-platform-spectrum/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 20:51:02 +0000</pubDate>
		<dc:creator>Dietrich Kappe</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Adobe AIR]]></category>
		<category><![CDATA[Custom Application Development]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex, Flash and Air]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Rich Internet Apps]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Software Development Best Practices]]></category>
		<category><![CDATA[iPhone/Mobile]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Swing]]></category>
		<category><![CDATA[WinForms]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1318</guid>
		<description><![CDATA[At Pathfinder we do a fair amount of desktop style development -- iPhone/Cocoa, WebForms, Swing -- and web application development -- Grails, Rails, JSP, ASP.NET, etc., etc.. In the last two years we, like a lot of other software development shops, have experienced a convergence in our efforts. The web is coming to the desktop [...]<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/12/puremvc-spanning-the-platform-spectrum/">PureMVC, Spanning the Platform Spectrum?</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/12/learning-puremvc-the-hard-way-is-there-any-other-way/' rel='bookmark' title='Permanent Link: Learning PureMVC the Hard Way (is there any other way?)'>Learning PureMVC the Hard Way (is there any other way?)</a></li><li><a href='http://www.pathf.com/blogs/2008/12/using-flex-code-generator-fcg-with-flex-puremvc/' rel='bookmark' title='Permanent Link: Using Flex Code Generator (FCG) with Flex &#038; PureMVC'>Using Flex Code Generator (FCG) with Flex &#038; PureMVC</a></li><li><a href='http://www.pathf.com/blogs/2009/01/flare-on-puremvc-in-flex-example/' rel='bookmark' title='Permanent Link: Flare on PureMVC in Flex example'>Flare on PureMVC in Flex example</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src='http://puremvc.org/pages/images/PureMVC-Blogosphere.png' alt='PureMVC' class='alignnone' style="float:right;padding:10px" />At Pathfinder we do a fair amount of desktop style development -- iPhone/Cocoa, WebForms, Swing -- and web application development -- Grails, Rails, JSP, ASP.NET, etc., etc.. In the last two years we, like a lot of other software development shops, have experienced a convergence in our efforts. The web is coming to the desktop in the form of Air and the Desktop is coming to the web in the form of RIA's. Now web MVC, which used to be a pretty benign pattern mostly concerned with app flow and validation, is starting to resemble desktop MVC, which has to deal with document-centric models and long lived views and all of the plumbing that requires.</p>
<p>So we recently had a powwow between all the different parties to talk about MVC and this convergence. With the exception of the insufferable Mac and iPhone developers and their <a href="http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/CocoaDesignPatterns/chapter_5_section_4.html" target="_blank">disgustingly mature Cocoa framework</a>,  we all agreed it would be nice to have an application level MVC framework for each platform. We also agreed that Swing is a great example of what happens when the vendor doesn't provide such a thing -- spaghetti code that relies on component level MVC and hard wiring at the application level. There are a few MVC frameworks for Swing, such as <a href="http://www.javaworld.com/javaworld/jw-06-2005/jw-0620-tikeswing.html" target="_blank">TikeSwing</a> and <a href="http://spring-rich-c.sourceforge.net/1.0.0/index.html" target="_blank">Spring Rich Client</a> (soon to be superseded by Spring Desktop), but for every Swing app that has this sort of design, there are hundreds that are just a mess.<br />
<span id="more-1318"></span><br />
Most of us felt that RIA's, including Flash and Flex apps, were suffering from the same framework vacuum. Wouldn't it be nice, we thought, if there was a common framework between all of these platforms, that brought application level MVC to the party? Sasha, our Flex lead, mentioned <a href="http://trac.puremvc.org/PureMVC" target="_blank">PureMVC</a>, a "simple" framework that has its origins in ActionScript. It now has ports to Java, GWT, C#, Objective-C, PHP, Python and JavaScript. We'll be evaluating this framework over the next few months to see if it is suitable as a general solution for our RIA's and desktop apps.</p>
<p>If any of our readers have experience with PureMVC or any other cross platform MVC frameworks, feel free to comment.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/12/puremvc-spanning-the-platform-spectrum/">PureMVC, Spanning the Platform Spectrum?</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/12/learning-puremvc-the-hard-way-is-there-any-other-way/' rel='bookmark' title='Permanent Link: Learning PureMVC the Hard Way (is there any other way?)'>Learning PureMVC the Hard Way (is there any other way?)</a></li><li><a href='http://www.pathf.com/blogs/2008/12/using-flex-code-generator-fcg-with-flex-puremvc/' rel='bookmark' title='Permanent Link: Using Flex Code Generator (FCG) with Flex &#038; PureMVC'>Using Flex Code Generator (FCG) with Flex &#038; PureMVC</a></li><li><a href='http://www.pathf.com/blogs/2009/01/flare-on-puremvc-in-flex-example/' rel='bookmark' title='Permanent Link: Flare on PureMVC in Flex example'>Flare on PureMVC in Flex example</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/12/puremvc-spanning-the-platform-spectrum/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GWT and the Discipline of MVC</title>
		<link>http://www.pathf.com/blogs/2008/12/gwt-and-the-discipline-of-mvc/</link>
		<comments>http://www.pathf.com/blogs/2008/12/gwt-and-the-discipline-of-mvc/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 22:52:15 +0000</pubDate>
		<dc:creator>Dietrich Kappe</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Software Development Best Practices]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1313</guid>
		<description><![CDATA[When you're developing a desktop or GWT application you're going to go through a bunch of iterations, tweaking the UI, adding components, etc. Sometimes in all of that work it is very tempting to take a shortcut and update a view directly from a controller (label.setText(model.messsageString)). That way lies madness. Before long you've got your [...]<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/12/gwt-and-the-discipline-of-mvc/">GWT and the Discipline of MVC</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/04/remove-bubbling-for-an-event-in-flex3/' rel='bookmark' title='Permanent Link: Remove/Cancel Bubbling for an Event in Flex3'>Remove/Cancel Bubbling for an Event in Flex3</a></li><li><a href='http://www.pathf.com/blogs/2006/11/adding_a_timer_/' rel='bookmark' title='Permanent Link: Adding a Timer Component to Echo2'>Adding a Timer Component to Echo2</a></li><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/' rel='bookmark' title='Permanent Link: Bean of the Devil: Tally-Ho CMS'>Bean of the Devil: Tally-Ho CMS</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>When you're developing a desktop or GWT application you're going to go through a bunch of iterations, tweaking the UI, adding components, etc. Sometimes in all of that work it is very tempting to take a shortcut and update a view directly from a controller (<code>label.setText(model.messsageString)</code>). That way lies madness. Before long you've got your view code strewn across the length and breadth of your application. Change the view or some aspect of the model and you're on a refactoring of biblical proportions.</p>
<p>In fact there's never a good time to break out of MVC, but sometimes you just don't know what sort of <em>Observable</em> your model should be. Will you be using a table, a tree, some custom component? In those situations I try to preserve MVC while punting the hard decision until later. To this end, I've written a little set of utility classes called <code>SimpleModel</code>. How do you use <code>SimpleModel</code>?<br />
<span id="more-1313"></span></p>
<pre class="java5"><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Label.html"><span style="color: #aaaadd; font-weight: bold;">Label</span></a> error = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Label.html"><span style="color: #aaaadd; font-weight: bold;">Label</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span>;
SimpleModel errorModel = <span style="color: #000000; font-weight: bold;">new</span> SimpleModel<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
errorModel.<span style="color: #006600;">addSimpleModelListener</span><span style="color: #66cc66;">&#40;</span>SimpleModelListener <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> onChange<span style="color: #66cc66;">&#40;</span>SimpleModelEvent event<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html"><span style="color: #aaaadd; font-weight: bold;">String</span></a> oldModel = event.<span style="color: #006600;">getOldModel</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        <a href="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html"><span style="color: #aaaadd; font-weight: bold;">String</span></a> newModel = event.<span style="color: #006600;">getNewModel</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
        error.<span style="color: #006600;">setText</span><span style="color: #66cc66;">&#40;</span>newModel<span style="color: #66cc66;">&#41;</span>;
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">// wire up the GUI here</span>
&nbsp;
<span style="color: #808080; font-style: italic;">// now change the model</span>
errorModel.<span style="color: #006600;">setModel</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;This should show up as an error&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre>
<p>Very simple. No deltas, no change, remove or insert events. But it does get you hooking up your V to your M without clogging up your C. If, at some later point, you decide to move to a <code>Tree</code>, you will need to wire up the MVC a little differently, but at least the separation is already there. No serious refactoring necessary.</p>
<p>Ideally you'd like to have the listener code resident in your view, but for purposes of illustration, I used a simple <code>Label</code> rather than a <code>Composite</code> widget.</p>
<p>My <code>SimpleModel</code> has a special <code>SlicedSimpleModel</code> that uses timers to dispatch each listener separately. That shields against long running listeners.</p>
<pre class="java5"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SlicedSimpleModel <span style="color: #000000; font-weight: bold;">extends</span> SimpleModel <span style="color: #66cc66;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> fireSimpleModelEvent<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> SimpleModelEvent event<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>listeners == <span style="color: #b13366;">null</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">return</span>;
        <span style="color: #66cc66;">&#125;</span>
        <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> SimpleModelListener listener : listeners<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
            <a href="http://www.google.com/search?sitesearch=java.sun.com&amp;q=allinurl%3Aj2se%2F1+5+0%2Fdocs%2Fapi+Timer"><span style="color: #aaaadd; font-weight: bold;">Timer</span></a> t = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?sitesearch=java.sun.com&amp;q=allinurl%3Aj2se%2F1+5+0%2Fdocs%2Fapi+Timer"><span style="color: #aaaadd; font-weight: bold;">Timer</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
&nbsp;
                <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> run<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
                    listener.<span style="color: #006600;">onChange</span><span style="color: #66cc66;">&#40;</span>event<span style="color: #66cc66;">&#41;</span>;
                <span style="color: #66cc66;">&#125;</span>
            <span style="color: #66cc66;">&#125;</span>;
            t.<span style="color: #006600;">schedule</span><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#41;</span>; <span style="color: #808080; font-style: italic;">// run right away</span>
        <span style="color: #66cc66;">&#125;</span>
    <span style="color: #66cc66;">&#125;</span>
<span style="color: #66cc66;">&#125;</span></pre>
<p>Anyhow, if there is interest, I can add <code>SimpleModel</code> to the <a href="http://code.google.com/p/gwt-jsonwrapper/" target="_blank">jsonwrapper</a> project. But whether you use my utility code or write your own, make sure to wire your GUI's up as MVC even when you're just spitballing.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/12/gwt-and-the-discipline-of-mvc/">GWT and the Discipline of MVC</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/04/remove-bubbling-for-an-event-in-flex3/' rel='bookmark' title='Permanent Link: Remove/Cancel Bubbling for an Event in Flex3'>Remove/Cancel Bubbling for an Event in Flex3</a></li><li><a href='http://www.pathf.com/blogs/2006/11/adding_a_timer_/' rel='bookmark' title='Permanent Link: Adding a Timer Component to Echo2'>Adding a Timer Component to Echo2</a></li><li><a href='http://www.pathf.com/blogs/2009/03/bean-of-the-devil-tally-ho-cms/' rel='bookmark' title='Permanent Link: Bean of the Devil: Tally-Ho CMS'>Bean of the Devil: Tally-Ho CMS</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/12/gwt-and-the-discipline-of-mvc/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 2: First pass at the actual code</title>
		<link>http://www.pathf.com/blogs/2008/08/implementing-linked-multiselects-with-jquery-livequery-and-low-pro-part-2-first-pass-at-the-actual-code/</link>
		<comments>http://www.pathf.com/blogs/2008/08/implementing-linked-multiselects-with-jquery-livequery-and-low-pro-part-2-first-pass-at-the-actual-code/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 19:54:33 +0000</pubDate>
		<dc:creator>Brian Dillard</dc:creator>
				<category><![CDATA[Rich Internet Apps]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=1115</guid>
		<description><![CDATA[
In last week's post, I introduced the linked multiselect widget I was asked to implement on a tight deadline for an unexpected project assignment. I showed some demo code in action and discussed the user experience issues that shaped my requirements. This week, I'll walk through the actual code - or at least my first [...]<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/08/implementing-linked-multiselects-with-jquery-livequery-and-low-pro-part-2-first-pass-at-the-actual-code/">Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 2: First pass at the actual code</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/08/implementing-linked-multiselects-with-jquery-livequery-and-low-pro-part-1-requirements-and-interaction-design/' rel='bookmark' title='Permanent Link: Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 1: Requirements and interaction design'>Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 1: Requirements and interaction design</a></li><li><a href='http://www.pathf.com/blogs/2008/06/writing-reusable-jquery-modules-make-everything-a-plugin/' rel='bookmark' title='Permanent Link: Writing reusable jQuery modules: Make everything a plugin'>Writing reusable jQuery modules: Make everything a plugin</a></li><li><a href='http://www.pathf.com/blogs/2009/01/jquery-13-plugins-continue-to-migrate-to-the-core/' rel='bookmark' title='Permanent Link: jQuery 1.3: Plugins continue to migrate to the core'>jQuery 1.3: Plugins continue to migrate to the core</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.pathf.com/blogs/wp-content/uploads/2008/08/lowproforjquery.jpg"><img class="right" title="Low Pro for jQuery" src="http://www.pathf.com/blogs/wp-content/uploads/2008/08/lowproforjquery.jpg" alt="Low Pro for jQuery" width="150" height="127" /></a></p>
<p>In <a href="http://www.pathf.com/blogs/2008/08/implementing-linked-multiselects-with-jquery-livequery-and-low-pro-part-1-requirements-and-interaction-design/">last week's post</a>, I introduced the linked multiselect widget I was asked to implement on a tight deadline for an unexpected project assignment. I showed <a href="http://labs.pathf.com/ajax/blogposts/08182008/demo.html">some demo code in action</a> and discussed the user experience issues that shaped my requirements. This week, I'll walk through the actual code - or at least my first pass at it.</p>
<p>Like a lot of developers who should know better, I sometimes shirk the technical design phase on quick projects, then regret it later. The code I handed off for this project got the job done, but it wasn't very DRY or elegant. Luckily, I've continued to refine it into something I'm not ashamed to blog about. Next week, I'll show off the final, refactored code and try to draw some conclusions about the entire experience. But first - the original, unrefactored code:</p>
<p><span id="more-1115"></span></p>
<h3>The good</h3>
<p>Working with new jQuery plugins always makes a project more interesting. I decided now was the time to get started with Dan Webb's <a href="http://www.danwebb.net/2008/1/31/low-pro-for-jquery">Low Pro for jQuery</a>, a library that adds class-based inheritance and other syntactic conveniences to the <code>jQuery</code> object, including an <code>attach</code> method for linking DOM nodes to prepackaged behaviors. The best, most reusable code I wrote for my initial pass at this project was constructed using Low Pro.</p>
<p>One requirement for my project was the creation of a simple color fade effect to signal DOM updates to the user. Using Low Pro, I was able to abstract this single behavior into its own reusable class for deployment within my larger application. The code looks like this:</p>
<pre>//a reusable class to add
//a classic Web 2.0 yellow fade
//to DOM elements that have changed
SignalChange = $.klass({
  defaults: {
    //length of the fadeout
    duration: 1250
    //baseline and highlight colors
    , defaultBorderColor: "#ccc"
    , defaultBackgroundColor: "#eee"
    , highlightBorderColor: "#000"
    , highlightBackgroundColor: "#ffa"
  }
  , initialize: function(options) {
    var opts = $.extend({}, this.defaults, options);
    $.extend(this, opts);//just copy over all the options
  }
  , onredraw: function() {
    var that = this;
    this.element
      //cancel previous events of this type
      .stop("onredraw")
      .css({
        backgroundColor: that.highlightBackgroundColor
        , borderColor: that.highlightBorderColor
      })
      .animate({
        backgroundColor: that.defaultBackgroundColor
        , borderColor: that.defaultBorderColor
      }, this.duration)
    ;
  }
});

$('.multiselect .scrollbox').attach(SignalChange);</pre>
<p>jQuery pros will notice that the CSS magic in my <code>onredraw</code> method relies on <a href="http://plugins.jquery.com/project/color">jQuery Color Animations</a>, a tiny little add-on by jQuery creator John Resig that extends the library's core FX mechanism to handle color transformations. In fact, I had to hack the plugin itself, since it handles borderBottomColor, borderLeftColor, borderRightColor and borderTopColor - but not borderColor. Strange, that, but I got over it. I wanted my color fade effect to support borders as well as backgrounds, and it seemed easier to add a single item to an array in the plugin than to handle each section of the border separately in my own behavior.</p>
<p>The syntax of Low Pro's <code>klass</code> method looks pretty similar to Prototype's <code>Class</code> mechanism, which makes sense. The <a href="http://www.danwebb.net/lowpro">original Low Pro</a> is a library for making Prototype more like jQuery, while Low Pro for jQuery is designed to give Prototype-style support for large, complex and subclassable objects to jQuery.</p>
<p>Notice some of the elegance in Webb's syntax: Any method that conforms to the <code>onwhatever</code> naming convention is assumed to be an event listener - even if it's a custom event such as my own <code>onredraw</code>. Once I've pointed my <code>SignalChange</code> behavior at a DOM node using the <code>attach</code> method, I just need to fire that event to trigger my custom listener. The same is true for native events.</p>
<p>Given the simplicity of my behavior, it could easily have been constructed as a plain old jQuery plugin. But even for such a low-level behavior, Low Pro offers some advantages:</p>
<ul>
<li>If <a href="http://brandonaaron.net/docs/livequery/">Live Query</a> is running, then any calls to Low Pro's <code>attach</code> method are routed through Live Query so they'll be applied to all matching DOM nodes, even those constructed subsequently via DHTML or Ajax.</li>
<li>I can also subclass my behavior more easily using Low Pro than jQuery's built-in plugin mechanism.</li>
</ul>
<p>This inheritance becomes all the more important when your behaviors are more complex, with multiple linked event listeners. Because you can just subclass a Low Pro klass, you don't need to overload it with some insane options hash. You can just create a new subclass for each slightly different implementation. I'll take advantage of this mechanism in the refactored code I show off next week.</p>
<h3>The not-so-good</h3>
<p>In the meantime, I have to take responsibility for the other Low Pro klass I created in this initial version: <code>Subscriptions</code>, which you can <a href="http://labs.pathf.com/ajax/blogposts/08182008/js/application.js">view in full in the source code.</a> Before I get into this code's deficiencies, let's look at what it does right:</p>
<ul>
<li>It makes great use of jQuery Templates to simplify the construction of DOM nodes. Templates such as the following keep me from having to concatenate strings to create my on-the-fly markup:
<pre>  this.tmplMemberView = $.template(
    '&lt;div class="item"&gt;' +
      '${name}' +
      ' &lt;span class="info"&gt;(' +
      '${groupCount:pluralize(group)})&lt;/span&gt;' +
      '&lt;/div&gt;'
  )</pre>
<p>I even added some useful helper methods to the <code>template</code> method so I could customize the formatting of my templates:</p>
<pre>//add some additional template helpers
//for the template plugin;
//use these to format our markup
$.extend($.template.helpers, {
  addConditionalClass: function(value, trueClass, falseClass) {
    return value === true ? trueClass : falseClass;
  }
  , addIfTrue: function(value, conditionalText) {
    return value === true ? conditionalText : '';
  }
  , addIfFalse: function(value, conditionalText) {
    return value === false ? conditionalText : '';
  }
  //only works for standard plurals
  , pluralize: function(value, label) {
    return value + " " + label + (value != 1 ? "s" : "");
  }
  , count: function(value, label) {
    var r = value.length || 0;
    if (label) {
      r = $.template.helpers.pluralize.call(this, r, label);
    }
    return r;
  }
});</pre>
</li>
<li>It leverages Live Query to attach permanent behaviors to DOM nodes that get destroyed and recreated many times over the application lifecycle.</li>
<li>It does a good job of wiring up the complex interactions between two interdependent linked multiselects.</li>
</ul>
<p>However, my code accomplishes most of these things in a most inelegant way. Looking back, I should have modeled a more complex object hierarchy with some sort of reusable <code>LinkedMultiselect</code> object. My Subscriptions object should have been responsible solely for wiring together two of these <code>LinkedMultiselect</code>s and enforcing data dependencies between them.</p>
<p>By starting with one great big all-encompassing class, I ended up having to everything four times: once each for the "selected" and "unselected" states of each of the two linked multiselects. The result is code like this, in which I have to create a single method and then create four more methods to bind it to different circumstances:</p>
<pre>, getSubGroup: function(coll, prop, state) {
  return $.grep(coll, function(n) {
    return n[prop] === state;
  });
}
, getSubscribedMembers: function() {
  return this.getSubGroup(this.members, "subscribedNow", true);
}
, getUnsubscribedMembers: function() {
  return this.getSubGroup(this.members, "subscribedNow", false);
}
, getEligibleGroups: function() {
  return this.getSubGroup(this.groups, "eligibleNow", true);
}
, getIneligibleGroups: function() {
  return this.getSubGroup(this.groups, "eligibleNow", false);
}</pre>
<p>By now, we've all been exposed to enough proper object-oriented JavaScript to do better than this. I know I certainly have, but I fell into the trap of coding rather than designing first. I look forward to showing you the refactored version next week.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/08/implementing-linked-multiselects-with-jquery-livequery-and-low-pro-part-2-first-pass-at-the-actual-code/">Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 2: First pass at the actual code</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/08/implementing-linked-multiselects-with-jquery-livequery-and-low-pro-part-1-requirements-and-interaction-design/' rel='bookmark' title='Permanent Link: Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 1: Requirements and interaction design'>Implementing linked multiselects with jQuery, LiveQuery, and Low Pro: Part 1: Requirements and interaction design</a></li><li><a href='http://www.pathf.com/blogs/2008/06/writing-reusable-jquery-modules-make-everything-a-plugin/' rel='bookmark' title='Permanent Link: Writing reusable jQuery modules: Make everything a plugin'>Writing reusable jQuery modules: Make everything a plugin</a></li><li><a href='http://www.pathf.com/blogs/2009/01/jquery-13-plugins-continue-to-migrate-to-the-core/' rel='bookmark' title='Permanent Link: jQuery 1.3: Plugins continue to migrate to the core'>jQuery 1.3: Plugins continue to migrate to the core</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/08/implementing-linked-multiselects-with-jquery-livequery-and-low-pro-part-2-first-pass-at-the-actual-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Pattern 7: Required fields</title>
		<link>http://www.pathf.com/blogs/2008/05/design-pattern/</link>
		<comments>http://www.pathf.com/blogs/2008/05/design-pattern/#comments</comments>
		<pubDate>Thu, 08 May 2008 16:20:58 +0000</pubDate>
		<dc:creator>Michael Dain</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[uxd]]></category>
		<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/05/design-pattern/</guid>
		<description><![CDATA[It is one of the first problems of HTML markup that had no standard way to communicate to the user what they should do, I'm talkin' about the required form field. Personally, I have used some sort of asterisk in...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/05/design-pattern/">Design Pattern 7: Required fields</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li><li><a href='http://www.pathf.com/blogs/2008/05/net-interface-d/' rel='bookmark' title='Permanent Link: .NET Interface does not allow static/const/readonly fields'>.NET Interface does not allow static/const/readonly fields</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-pattern-2/' rel='bookmark' title='Permanent Link: Design Pattern 4 &#8211; Inline help'>Design Pattern 4 &#8211; Inline help</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img title="Reqall1" src="http://blogs.pathf.com/photos/uncategorized/2008/05/08/reqall1.jpg" border="0" alt="Reqall1" /></p>
<p>It is one of the first problems of HTML markup that had no standard way to communicate to the user what they should do, I'm talkin' about the <strong>required</strong> form field. Personally, I have used some sort of asterisk in the past, coloration can work as well, but anything eye catching can distract from an error state (hey, you didn't notice we required that field, try again). So it caught my eye that the good people at <a href="http://www.reqall.com">reqall</a> have an interesting pattern. In this case, make required fields have a bottom that is different from the non-required fields. This is fairly subtle, it took me a moment to figure out what it meant, but I give them kudos for trying something new. This is a long neglected design pattern of how to handle this in a consistent way, and this is a good a place to start. Its also a way to give a shout out to this service which mashes up text-to-speech, reminder lists, task distribution and has a nifty iphone interface as well, <a href="http://www.reqall.com">check it out</a>!</p>
<p>How to do it</p>
<p>Here's a capture from their stylesheet, an interesting element here is I didn't know that you could restyle the drawn box of an input, so there is room for much variation. I also like the way they specified 'solid' to get rid of the horrid default 'picture frame' style of merging <a href="http://www.tizag.com/cssT/border.php">borders when they don't match</a>, which always makes me flashback to 1998 web design.</p>
<pre class="css">input<span style="color: #6666ff;">.essential</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #000000; font-weight: bold;">border-top-width</span>: <span style="color: #933;">1px</span>;
<span style="color: #000000; font-weight: bold;">border-right-width</span>: <span style="color: #933;">1px</span>;
<span style="color: #000000; font-weight: bold;">border-bottom-width</span>: <span style="color: #933;">3px</span>;
<span style="color: #000000; font-weight: bold;">border-left-width</span>: <span style="color: #933;">1px</span>;
<span style="color: #000000; font-weight: bold;">border-top-style</span>: <span style="color: #993333;">solid</span>;
<span style="color: #000000; font-weight: bold;">border-right-style</span>: <span style="color: #993333;">solid</span>;
<span style="color: #000000; font-weight: bold;">border-bottom-style</span>: <span style="color: #993333;">solid</span>;
<span style="color: #000000; font-weight: bold;">border-left-style</span>: <span style="color: #993333;">solid</span>;
<span style="color: #000000; font-weight: bold;">border-top-color</span>: <span style="color: #cc00cc;">#<span style="color: #933;">016098</span></span>;
<span style="color: #000000; font-weight: bold;">border-right-color</span>: <span style="color: #cc00cc;">#<span style="color: #933;">016098</span></span>;
<span style="color: #000000; font-weight: bold;">border-bottom-color</span>: <span style="color: #cc00cc;">#<span style="color: #933;">990000</span></span>;
<span style="color: #000000; font-weight: bold;">border-left-color</span>: <span style="color: #cc00cc;">#<span style="color: #933;">016098</span></span>;
<span style="color: #66cc66;">&#125;</span></pre>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/05/design-pattern/">Design Pattern 7: Required fields</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li><li><a href='http://www.pathf.com/blogs/2008/05/net-interface-d/' rel='bookmark' title='Permanent Link: .NET Interface does not allow static/const/readonly fields'>.NET Interface does not allow static/const/readonly fields</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-pattern-2/' rel='bookmark' title='Permanent Link: Design Pattern 4 &#8211; Inline help'>Design Pattern 4 &#8211; Inline help</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/05/design-pattern/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Design Pattern 6: Definition lists : point/counterpoint</title>
		<link>http://www.pathf.com/blogs/2008/04/design-patter-2/</link>
		<comments>http://www.pathf.com/blogs/2008/04/design-patter-2/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 15:05:58 +0000</pubDate>
		<dc:creator>Michael Dain</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[uxd]]></category>
		<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/04/design-patter-2/</guid>
		<description><![CDATA[If you have a list that opens and closes by clicking on a header the most fitting markup is a definition list. For some reason these elements are mysterious and not too often used. The trick is to get all the behavior attached to it with no heavy lifting...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/04/design-patter-2/">Design Pattern 6: Definition lists : point/counterpoint</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/02/design-patter-1-2/' rel='bookmark' title='Permanent Link: Design Pattern 3 &#8211; not page flips'>Design Pattern 3 &#8211; not page flips</a></li><li><a href='http://www.pathf.com/blogs/2008/05/design-pattern/' rel='bookmark' title='Permanent Link: Design Pattern 7: Required fields'>Design Pattern 7: Required fields</a></li><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I encountered a <a href="http://blogs.pathf.com/agileajax/2008/04/hide-and-go-see.html">similar situation to Noel's</a> when developing a site recenty. The design called for, or made reference to, a opening and closing header with details shown or hidden by a click on that header. I approached it in a different way, which may be interesting to compare the two, but leave it out there to debate the merits of each. When solving a problem, I normally begin with the same axiom that was mentioned in an earlier post - What is it? What is it's nature? HTML markup, as you may know doesn't have much in it, a mere 20 or so tags, but with the addition of ID's or classes, you can uniquely identify everything the web has to deliver, which is pretty powerful.</p>
<p><img class="image-full" style="10px;" src="http://blogs.pathf.com/photos/uncategorized/2008/04/16/directory_list.jpg" border="0" alt="Directory_list" /><br />
<img style="10px;" src="http://blogs.pathf.com/photos/uncategorized/2008/04/17/listcode.jpg" border="0" alt="Listcode" /></p>
<p>In looking at the elements controlled by another element, the most fitting markup is a definition list. For some  reason these elements are mysterious and not too often used. It is a list &lt;dl&gt; that can contain two elements &lt;dt&gt;  and &lt;dd&gt;. Normally they have a default display of one element being bigger and the other slightly indented, as to look like a directory. So, with little or no work we can describe the two types of list elements, the 'header' - &lt;dt&gt; and the information that can be 'opened' the &lt;dd&gt;.</p>
<p>So having my markup, well, marked up, I can set aside the HTML, produce some styles for the list, but what about the complicated part? Adding the behavior to hide/show, make the &lt;dt&gt; clickable, swap the GIF's that indicate opening and closing, and while we're at it why not a 'expand all' or 'close all'. Finding it was no mean feat, but with some very creative google searching I found the script - <a href="http://www.tjkdesign.com/articles/toggle_elements.asp">http://www.tjkdesign.com/articles/toggle_elements.asp</a>. So this handles all the heavy lifting, and basically degrades nicely in a non-javascript situation to show all elements. Problem solved.</p>
<p>The satisfying thing about this solution is that the code is clean, and easy to change, and any presentation issues are handled within CSS, along with any behavior in javascript, and handled by the client. I think the two approaches compliment and contrast each other nicely, add your own solutions to the comments if there are even better ones.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/04/design-patter-2/">Design Pattern 6: Definition lists : point/counterpoint</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/02/design-patter-1-2/' rel='bookmark' title='Permanent Link: Design Pattern 3 &#8211; not page flips'>Design Pattern 3 &#8211; not page flips</a></li><li><a href='http://www.pathf.com/blogs/2008/05/design-pattern/' rel='bookmark' title='Permanent Link: Design Pattern 7: Required fields'>Design Pattern 7: Required fields</a></li><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/04/design-patter-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Design Pattern 4 &#8211; Inline help</title>
		<link>http://www.pathf.com/blogs/2008/04/design-pattern-2/</link>
		<comments>http://www.pathf.com/blogs/2008/04/design-pattern-2/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 19:15:01 +0000</pubDate>
		<dc:creator>Michael Dain</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[uxd]]></category>
		<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/04/design-pattern-2/</guid>
		<description><![CDATA[I just had quite an enjoyable spring break trip with the family to Washington DC. For a town with lots of visitors, it was important to help people manage the different ways to get around, or more importantly get out...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/04/design-pattern-2/">Design Pattern 4 &#8211; Inline help</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/05/design-pattern/' rel='bookmark' title='Permanent Link: Design Pattern 7: Required fields'>Design Pattern 7: Required fields</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-patter-1/' rel='bookmark' title='Permanent Link: Design Pattern 5: Can u rd this?'>Design Pattern 5: Can u rd this?</a></li><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I just had quite an enjoyable spring break trip with the family to Washington DC. For a town with lots of visitors, it was important to help people manage the different ways to get around, or more importantly get out of the way of the residents. Among many places, within the beautifully designed metro stations,  there was often voice over assistance on different helpful topics. While I was surprised at the lack of multi-language support amongst these alerts, there was a particular custom that made me think of a similar pattern in software design, the help system.</p>
<p>Often designed separately, help in software systems is almost always out of sight of the actual user experience, and thus out of mind. On my projects I make it the habit to make room for, and design with inline help in mind. <em>Inline</em> meaning the help topic is written out on the page next to the area where it will be consumed. I find it keeps people from having to take fingers off the keyboard and mouseover a "?" icon to see if it anything helpful is there hiding. During planning, if the final text is missing, placeholder text is substituted. It helps show the developers that labels alone cannot help users determine how to proceed with completing the task. It also reminds us of what kind of help will be needed eventually in each interaction. I'm surprised at how much reaction it spurns in design meetings and helps clarify confusing procedures amongst other benefits. In short, the pattern is to provide some help where we are looking, rather than make users hunt, or worse, ask for it. <a onclick="window.open(this.href, '_blank', 'width=402,height=345,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.pathf.com/.shared/image.html?/photos/uncategorized/2008/04/07/steps.jpg"><img style="float: right; margin: 0px 0px 5px 5px;" title="Steps" src="http://blogs.pathf.com/uxd/images/2008/04/07/steps.jpg" border="0" alt="Steps" hspace="10" vspace="10" width="250" height="214" /></a></p>
<p>Back to DC, in the Smithsonian, as well as the metro, there are many escalators, and if you pay attention to the voice over, the helpful message is to "stand on the left and walk on the right". Having been plowed into more than a dozen times by people trying to get past me, it finally dawned on me that this is lacking inline help. I took this (blurry) picture in the Smithsonian, which it had two footprints on each side of the tread. The 'help' actually <em>contradicted</em> the rule. With some bad photoshop I erased the footsteps to  the version shown here. While reminiscent of some ancient dance chart, I thought if this was the way it was stenciled, that people pick up on the intended behavior because it is where their focus is, not on the announcement, but on their feet.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/04/design-pattern-2/">Design Pattern 4 &#8211; Inline help</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/05/design-pattern/' rel='bookmark' title='Permanent Link: Design Pattern 7: Required fields'>Design Pattern 7: Required fields</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-patter-1/' rel='bookmark' title='Permanent Link: Design Pattern 5: Can u rd this?'>Design Pattern 5: Can u rd this?</a></li><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/04/design-pattern-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Two Years of Agile Ajax: Web Killed Off GUI Techniques Just in Time for Ajax to Need them Again</title>
		<link>http://www.pathf.com/blogs/2008/03/two-years-of-ag/</link>
		<comments>http://www.pathf.com/blogs/2008/03/two-years-of-ag/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 10:17:00 +0000</pubDate>
		<dc:creator>Dietrich Kappe</dc:creator>
				<category><![CDATA[Rich Internet Apps]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[uxd]]></category>
		<category><![CDATA[Ajax Development]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Desktop RIA]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=43</guid>
		<description><![CDATA[I launched this blog just a little over two years ago, on March 21st, 2006. Appropriately enough, my first post was about User Experience (UXD) and Ajax. The blog has come a long way since then -- we've added another...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/03/two-years-of-ag/">Two Years of Agile Ajax: Web Killed Off GUI Techniques Just in Time for Ajax to Need them Again</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2007/01/more_articles_n/' rel='bookmark' title='Permanent Link: More Articles Needed on How to Design Ajax Apps, not Just How to Program Them'>More Articles Needed on How to Design Ajax Apps, not Just How to Program Them</a></li><li><a href='http://www.pathf.com/blogs/2006/05/ajax_only_large/' rel='bookmark' title='Permanent Link: AJAX: Only Large Corporations Can Play?'>AJAX: Only Large Corporations Can Play?</a></li><li><a href='http://www.pathf.com/blogs/2008/05/upcoming-talk-a-2/' rel='bookmark' title='Permanent Link: Upcoming Talk at RIApalooza: Fast. Smart. Agile. User Experience Driven Agile Development'>Upcoming Talk at RIApalooza: Fast. Smart. Agile. User Experience Driven Agile Development</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 0px 5px 5px 0px; float: left;" title="Hourglass" src="http://blogs.pathf.com/photos/uncategorized/2008/03/25/hourglass.jpg" border="0" alt="Hourglass" /><br />
I launched this blog just a little over two years ago, on March 21st, 2006. Appropriately enough, my <a href="http://blogs.pathf.com/agileajax/2006/03/user_experience.html">first post</a> was about User Experience (UXD) and Ajax. The blog has come a long way since then -- we've added another full-time blogger (Brain Dillard), published nearly 700 articles of original Ajax and Agile related content, and covered the major new innovations in Ajax and Web 2.0 -- but in many ways Ajax technology is still struggling with the same issues that I wrote about back then:</p>
<blockquote><p>As it stands, Ajax is still in its infancy (or in its wild west phase -- pick your metaphor), and Bill's simple three part "patterns" are emblematic of this.</p></blockquote>
<p><a class="performancingtags" rel="tag" href="http://technorati.com/tag/ria"> </a></p>
<p><span id="more-43"></span></p>
<p>Even two years later, Ajax is still in its infancy. At the AjaxWorld Conference East, I had the privilege of sitting next to <a href="http://en.wikipedia.org/wiki/Douglas_Crockford">Douglas 'JSON' Crockford</a><br />
on the final panel. As my parting wisdom to the assembled masses in the<br />
ballroom of the Roosevelt Hotel in Manhattan, I said that the web had<br />
taken us a step back, from desktop GUI's to the equivalent of the<br />
mainframe green screen, and that Ajax was reintroducing the event<br />
driven GUI concepts to the web. So web developers were going to have to<br />
learn a whole new bag of tricks if they wanted to make full use of the<br />
new technology.</p>
<p>Where to learn this different way of designing<br />
GUI's? The success of the web has sucked the air out of the room for<br />
GUI design books. Most of the books on the subject are either old, not<br />
very good, or both (see "Java GUI Development: The Authoritative<br />
Solution" or any Swing book for a typical example). There are some<br />
books over in the ActionScript/Flash and WinForms departments that do a<br />
better job. Online, most of the relevant projects have also died off<br />
(see this post I did from 2006: <a href="http://blogs.pathf.com/agileajax/2006/05/mvc_and_ria_an_.html">MVC and RIA - Learning From Desktop Apps</a>).<br />
Probably the best thing to do is to see which of your current web<br />
developers have experience from a past life developing desktop GUI's.<br />
Maybe I should crack my old Mac GUI programming books (fat chance of<br />
that).</p>
<p>P.S. When we were delivering our parting wisdom, I<br />
quipped that I shouldn't make any predictions because I had originally<br />
argued against the inclusion of the image tag in HTML, but I was<br />
starting to think that I might have been right. Douglas later asked me if I<br />
had removed some of the vowels from <code>IMG</code> in spite, and<br />
that the image tag was really the reason why the web succeeded. It's<br />
good to know that I was able to inspire one of his lesser <a href="http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li?p=783">blog posts</a>.</p>
<p>Technorati Tags: <a class="performancingtags" rel="tag" href="http://technorati.com/tag/ajax">ajax</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/gui">gui</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/desktop">desktop</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/event%20driven">event driven</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/mvc">mvc</a>, <a class="performancingtags" rel="tag" href="http://technorati.com/tag/ria">ria</a></p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/03/two-years-of-ag/">Two Years of Agile Ajax: Web Killed Off GUI Techniques Just in Time for Ajax to Need them Again</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2007/01/more_articles_n/' rel='bookmark' title='Permanent Link: More Articles Needed on How to Design Ajax Apps, not Just How to Program Them'>More Articles Needed on How to Design Ajax Apps, not Just How to Program Them</a></li><li><a href='http://www.pathf.com/blogs/2006/05/ajax_only_large/' rel='bookmark' title='Permanent Link: AJAX: Only Large Corporations Can Play?'>AJAX: Only Large Corporations Can Play?</a></li><li><a href='http://www.pathf.com/blogs/2008/05/upcoming-talk-a-2/' rel='bookmark' title='Permanent Link: Upcoming Talk at RIApalooza: Fast. Smart. Agile. User Experience Driven Agile Development'>Upcoming Talk at RIApalooza: Fast. Smart. Agile. User Experience Driven Agile Development</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/03/two-years-of-ag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Pattern 3 &#8211; not page flips</title>
		<link>http://www.pathf.com/blogs/2008/02/design-patter-1-2/</link>
		<comments>http://www.pathf.com/blogs/2008/02/design-patter-1-2/#comments</comments>
		<pubDate>Wed, 20 Feb 2008 16:27:38 +0000</pubDate>
		<dc:creator>Michael Dain</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[uxd]]></category>
		<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/02/design-patter-1-2/</guid>
		<description><![CDATA[In interaction design it is considered a noble pursuit to find metaphors that take real life interactions and mimic them onto the computer screen. There are some notable successes such as the desktop metaphor, as well as some notable failures,...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/02/design-patter-1-2/">Design Pattern 3 &#8211; not page flips</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-pattern-2/' rel='bookmark' title='Permanent Link: Design Pattern 4 &#8211; Inline help'>Design Pattern 4 &#8211; Inline help</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-patter-1/' rel='bookmark' title='Permanent Link: Design Pattern 5: Can u rd this?'>Design Pattern 5: Can u rd this?</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>In interaction design it is considered a noble pursuit to find metaphors that take real life interactions and mimic them onto the computer screen. There are some notable successes such as the desktop metaphor, as well as some notable failures, such as the desktop metaphor. It reminds me of a friend who was experiencing trouble with their hard drive (this was a macintosh) so they dragged all their files 'out' of the hard drive onto the desktop and then reformatted the drive. After doing this he understood that the metaphor didn't hold up to this kind of  use. As computer users become more savvy, metaphors that exist only in the computer realm are becoming more common and accepted.</p>
<p>I was perusing an online catalog, IKEA, and noticed they had dismissed the odd, yet well used idea of a page 'flipping' or 'dog-earing' when you clicked on the corner to advance. As seen in the movie, the advance takes place, shifts the page, then switches it with the next page. Not only does this transition take less time, it effectively communicates in shorthand the idea of 'flipping' without using a direct paper metaphor. Nicely done.<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="right" /><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/oBdDT19Gkx4&amp;rel=1" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/oBdDT19Gkx4&amp;rel=1" wmode="transparent" align="right"></embed></object></p>
<h3>When to use</h3>
<p>Pagination seems most useful when transitioning print to screen. Since many magazines and newspapers have abandoned the fidelity to print, and removed the need to screen capture print ready art, this is becoming rarer and rarer. I do think paginating between photos in an album is an experience not well handled in many photo sites web interfaces (I mean you flickr!).</p>
<h3>How does it work?</h3>
<p>Since this is flash, you can get away with the movement out of the constraining box, which is tougher in HTML, since absolute sizing is not as common, moving and swapping is probably available within a DHTML library, but movement across frames seems to be very flash specific behavior.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/02/design-patter-1-2/">Design Pattern 3 &#8211; not page flips</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-pattern-2/' rel='bookmark' title='Permanent Link: Design Pattern 4 &#8211; Inline help'>Design Pattern 4 &#8211; Inline help</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-patter-1/' rel='bookmark' title='Permanent Link: Design Pattern 5: Can u rd this?'>Design Pattern 5: Can u rd this?</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/02/design-patter-1-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design Pattern 1 &#8211; faded breadcrumbs</title>
		<link>http://www.pathf.com/blogs/2008/02/design-pattern-3/</link>
		<comments>http://www.pathf.com/blogs/2008/02/design-pattern-3/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 16:48:42 +0000</pubDate>
		<dc:creator>Michael Dain</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[uxd]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Information Architecture]]></category>
		<category><![CDATA[Rich Interactions]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/02/design-pattern-3/</guid>
		<description><![CDATA[Design Pattern 1 - faded breadcrumbs Originally uploaded by uuh...clem Preface: in my travels around the interwebs I often encounter a neat interaction design that I use my handy Skitch tool to capture. As of now, they sit there until...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/02/design-pattern-3/">Design Pattern 1 &#8211; faded breadcrumbs</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/04/design-patter-2/' rel='bookmark' title='Permanent Link: Design Pattern 6: Definition lists : point/counterpoint'>Design Pattern 6: Definition lists : point/counterpoint</a></li><li><a href='http://www.pathf.com/blogs/2008/02/design-patter-1-2/' rel='bookmark' title='Permanent Link: Design Pattern 3 &#8211; not page flips'>Design Pattern 3 &#8211; not page flips</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-pattern-2/' rel='bookmark' title='Permanent Link: Design Pattern 4 &#8211; Inline help'>Design Pattern 4 &#8211; Inline help</a></li></ol>]]></description>
			<content:encoded><![CDATA[<div style="float: right; margin-left: 10px; margin-bottom: 10px;"><a title="photo sharing" href="http://www.flickr.com/photos/uhh_clem/2250127453/"><img style="border: solid 2px #000000;" src="http://farm3.static.flickr.com/2114/2250127453_edfcde389f_m.jpg" alt="" /></a><br />
<span style="font-size: 0.9em; margin-top: 0px;"> <a href="http://www.flickr.com/photos/uhh_clem/2250127453/">Design Pattern 1 - faded breadcrumbs</a><br />
Originally uploaded by <a href="http://www.flickr.com/people/uhh_clem/">uuh...clem</a> </span></div>
<p>Preface: in my travels around the interwebs I often encounter a neat interaction design that I use my handy <a href="http://www.skitch.com">Skitch</a> tool to capture. As of now, they sit there until I encounter a project to use them in. To make them more accessible I'm going to post them here, please add comments, since many times I'm not sure how to actually implement these!</p>
<h3>Apple's faded breadcrumbs</h3>
<p>In (Leopard OS?) search windows, when a list is presented and an item is selected, the path to that item is shown as breadcrumbs in the footer. Because these items can be anywhere, the structure can be very deep, when horizontal room is at a premium, and folder names are long the display truncates the display to a fixed width and fades out the name to white. On mouseover, the title stretches open to show the entire label.</p>
<h4>What can it be used for?&gt;</h4>
<p>Windows offers the ability to "ellipses" a label that gets too big for it's container. On mouseover, a 'tooltip" window pops up showing the entire label. The fade approach is more elegant, and the animation is actually useful since you don't obscure the other information like popup tooltips do. Websites hopefully have flatter navigation structures nowadays, but horizontal space is always an issue, as it is always finite. Techniques to maximize horizontal space are welcome.</p>
<h4>How to do it?</h4>
<p><a href="http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/wa/RSLID?nnmm=browse&amp;mco=3587D037&amp;node=home/shop_ipod/family/ipod_classic">Apple.com</a> is showing this behavior on their footers, go to any page and look at the footer breadcrumbs, click on one and you get the animation effect. However, the fade is not possible in HTML. Also, apple seems to use some 'safari' behavior in their page I don't see in IE 6. Any ideas or libraries? Post below.</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/02/design-pattern-3/">Design Pattern 1 &#8211; faded breadcrumbs</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/04/design-patter-2/' rel='bookmark' title='Permanent Link: Design Pattern 6: Definition lists : point/counterpoint'>Design Pattern 6: Definition lists : point/counterpoint</a></li><li><a href='http://www.pathf.com/blogs/2008/02/design-patter-1-2/' rel='bookmark' title='Permanent Link: Design Pattern 3 &#8211; not page flips'>Design Pattern 3 &#8211; not page flips</a></li><li><a href='http://www.pathf.com/blogs/2008/04/design-pattern-2/' rel='bookmark' title='Permanent Link: Design Pattern 4 &#8211; Inline help'>Design Pattern 4 &#8211; Inline help</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/02/design-pattern-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agnostic lightboxing</title>
		<link>http://www.pathf.com/blogs/2008/01/agnostic-lightb/</link>
		<comments>http://www.pathf.com/blogs/2008/01/agnostic-lightb/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 23:34:44 +0000</pubDate>
		<dc:creator>Michael Dain</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[Design Patterns]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/01/agnostic-lightb/</guid>
		<description><![CDATA[The memo may not have gone out yet, but for a year or so now the scourge of popup windows has been erased from the user experience. I know that it has been blocked by browsers for quite a while...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/01/agnostic-lightb/">Agnostic lightboxing</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/03/my-ibm-develope/' rel='bookmark' title='Permanent Link: My IBM developerWorks series makes it debut'>My IBM developerWorks series makes it debut</a></li><li><a href='http://www.pathf.com/blogs/2008/06/jrails-ruby-on-rails-with-the-prototype-guts-ripped-out/' rel='bookmark' title='Permanent Link: jRails: Ruby on Rails with the Prototype guts ripped out'>jRails: Ruby on Rails with the Prototype guts ripped out</a></li><li><a href='http://www.pathf.com/blogs/2007/11/jrails-scriptac/' rel='bookmark' title='Permanent Link: JRails: Scriptaculous on top of JQuery'>JRails: Scriptaculous on top of JQuery</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>The memo may not have gone out yet, but for a year or so now the scourge of popup windows has been erased from the user experience. I know that it has been blocked by browsers for quite a while but UXD designers once and a while need this modal stalwart, the dialog box to get their business done without distractions. Thanks to great coders out there, we have a replacement we call "lightbox" which you experience probably daily as the darkening out of the screen and the overlay of that modal box. Its very quick to implement, easy to code, and with some variations, can hold music, slideshows and other nifty content types. I use it constantly, but it has one drawback, the reliance on either prototype or jquery as a backbone to do it's magic.</p>
<p>While I put myself kind of in the prototype + scriptaculous crowd, the battle between these libraries makes it hard since you can only include one of them. Thus someone writes some "perfect for your audience" lightbox effect, but you need to change to jquery to use it. This happened on my own site where some lightboxes needed to play mp3's and others needed to show image slideshows, I had to make compromises and change from page to page, which was extra work, and kind of weird.</p>
<p>No more, thanks to Mr. Jackson, we have a new lightbox (that uses the correct attribute 'rel') that can take advantage or either library, or even mootools or YUI, neato! Look forward to delving into it, check out the download at <a href="http://mjijackson.com/shadowbox/#markup"> http://mjijackson.com/shadowbox/</a> and cheers for choice!</p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/01/agnostic-lightb/">Agnostic lightboxing</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/03/my-ibm-develope/' rel='bookmark' title='Permanent Link: My IBM developerWorks series makes it debut'>My IBM developerWorks series makes it debut</a></li><li><a href='http://www.pathf.com/blogs/2008/06/jrails-ruby-on-rails-with-the-prototype-guts-ripped-out/' rel='bookmark' title='Permanent Link: jRails: Ruby on Rails with the Prototype guts ripped out'>jRails: Ruby on Rails with the Prototype guts ripped out</a></li><li><a href='http://www.pathf.com/blogs/2007/11/jrails-scriptac/' rel='bookmark' title='Permanent Link: JRails: Scriptaculous on top of JQuery'>JRails: Scriptaculous on top of JQuery</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/01/agnostic-lightb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Save That Duck!</title>
		<link>http://www.pathf.com/blogs/2008/01/save-that-duck/</link>
		<comments>http://www.pathf.com/blogs/2008/01/save-that-duck/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 21:57:52 +0000</pubDate>
		<dc:creator>Noel Rappin</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Analysis]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=118</guid>
		<description><![CDATA[So, while most of you were off celebrating the holidays, Dietrich was off [killing a duck][deadduck], or at least Duck Typing. Personally, I always thought that the goose was the traditional holiday bird.. shows what I know. Deitrich's argument is...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/01/save-that-duck/">Save That Duck!</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2007/12/dead-duck-typin/' rel='bookmark' title='Permanent Link: Dead Duck Typing and High Cohesion'>Dead Duck Typing and High Cohesion</a></li><li><a href='http://www.pathf.com/blogs/2007/12/live-ruby-testb/' rel='bookmark' title='Permanent Link: Live Ruby: Testbed, part two'>Live Ruby: Testbed, part two</a></li><li><a href='http://www.pathf.com/blogs/2008/04/hide-seek-and-s/' rel='bookmark' title='Permanent Link: Hide, Seek, and Stay Dry, part two: Controllers'>Hide, Seek, and Stay Dry, part two: Controllers</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>So, while most of you were off celebrating the holidays, Dietrich was off <a href="http://blogs.pathf.com/agileajax/2007/12/dead-duck-typin.html">killing a duck</a>, or at least Duck Typing. Personally, I always thought that the goose was the traditional holiday bird.. shows what I know.</p>
<p>Deitrich's argument is that Duck Typing does not allow "Dead Duck Typing", being able to restrict access to part of an object's state or functionality. The classic case here is keeping a display layer from getting at the persistence layer. (Maybe we can call this Stephen Colbert Typing, since you're declaring part of the object as "dead to me"...)</p>
<p>Dietrich closed his post with:</p>
<blockquote>
<p>Some will argue this is a Java-ism creeping into Ruby. I say this is just plain old-fashioned good OO design.</p>
</blockquote>
<p>Which I think is my cue.</p>
<p>I understand the theoretical argument for having strict (or stricter) access control in a system, and I certainly understand why having small, high cohesion classes is a good thing. My problem is that it's very rare for me to have a practical issue in a system because of loose access control or overly generous interfaces (granted, I've had a good run of working with smart people). On the other side, I commonly find that when I'm writing a program with access control I'd like to do something more flexible with an object, but I can't, because the original writer of the class did not anticipate the usage.</p>
<p>Specifically on the Ruby side, it's actually not hard at all to restrict access to an object. ActiveRecord objects can easily be made read only called before being passed to a view to protect from inadvertent changes. </p>
<p>In the more general case, it's not hard to do something like this, which only allows certain methods of an object to be called:</p>
<pre>
class ArbitraryProxy

def initialize(object, *methods)
@object = object
@methods = methods
end

def method_missing(method, *args)
if @methods.include? method
return @object.send(method, *args)
end
super
end

end

x = ArbitraryProxy.new("abcd", :size, :gsub)
p x.size
p x.gsub("b", "---")
p x.upcase
</pre>
<p>This returns:</p>
<pre>
4
"a---cd"
NoMethodError: undefined method ‘upcase’
</pre>
<p>The interesting thing is that, by and large, Rails developers don't feel the need to do this. I don't think I've ever seen an authoritative source suggest that it's best practice to make ActiveRecord objects read only before passing them to the view.  </p>
<p>There is a Rails plugin called Liquid that enforces the use of proxy objects before being passed to the view. It's not very widely used (in part because creating the proxies is kind of a pain). </p>
<p>I don't see that Ruby and Rails programmers see this issue as a practical problem facing them (it helps that Ruby tends to encourage small classes in other ways). That said, there are clearly cases where you need to be extra careful. Liquid is used as user-facing templating engine for a blog tool, which is clearly a case where you'd want to limit the damage that your template writers can do.</p>
<p>But I see that as the exception, not the rule. Long live the Duck!</p>
<hr />
<p>Coming Soon: <a href="http://www.amazon.com/gp/product/047022388X?ie=UTF8&amp;tag=10prinhell-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=047022388X">Professional Ruby on Rails</a> -- available in bookstores Mid-Februrary. </p>
<p><!-- Technorati Tags Start --></p>
<p>Technorati Tags:<br />
<a href="http://technorati.com/tag/ruby" rel="tag">ruby</a>, <a href="http://technorati.com/tag/OOAD" rel="tag">OOAD</a>, <a href="http://technorati.com/tag/Duck%20Typing" rel="tag">Duck Typing</a>
</p>
<p><!-- Technorati Tags End --></p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/01/save-that-duck/">Save That Duck!</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2007/12/dead-duck-typin/' rel='bookmark' title='Permanent Link: Dead Duck Typing and High Cohesion'>Dead Duck Typing and High Cohesion</a></li><li><a href='http://www.pathf.com/blogs/2007/12/live-ruby-testb/' rel='bookmark' title='Permanent Link: Live Ruby: Testbed, part two'>Live Ruby: Testbed, part two</a></li><li><a href='http://www.pathf.com/blogs/2008/04/hide-seek-and-s/' rel='bookmark' title='Permanent Link: Hide, Seek, and Stay Dry, part two: Controllers'>Hide, Seek, and Stay Dry, part two: Controllers</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/01/save-that-duck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Curse of Knowledge</title>
		<link>http://www.pathf.com/blogs/2008/01/the-curse-of-kn/</link>
		<comments>http://www.pathf.com/blogs/2008/01/the-curse-of-kn/#comments</comments>
		<pubDate>Fri, 04 Jan 2008 16:38:36 +0000</pubDate>
		<dc:creator>Sholom Sandalow</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Domain Knowledge]]></category>
		<category><![CDATA[Ideation]]></category>
		<category><![CDATA[Story Telling]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/01/the-curse-of-kn/</guid>
		<description><![CDATA[You can never know too much about something, right? Wrong, at least according to a December 30th article in the New York Times. As we become experts in a particular domain, our ability to innovate diminishes. "Andrew S. Grove, the...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/01/the-curse-of-kn/">The Curse of Knowledge</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2006/07/innovation_thro/' rel='bookmark' title='Permanent Link: Innovation Through “Crowdsourcing”'>Innovation Through “Crowdsourcing”</a></li><li><a href='http://www.pathf.com/blogs/2006/08/2_approaches_to/' rel='bookmark' title='Permanent Link: 2 approaches to design&#8230;'>2 approaches to design&#8230;</a></li><li><a href='http://www.pathf.com/blogs/2007/11/dux2007-ubiqu/' rel='bookmark' title='Permanent Link: DUX2007 &#8211; Ubiquitous Computing'>DUX2007 &#8211; Ubiquitous Computing</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>You can never know too much about something, right?&nbsp; Wrong, at least according to a December 30th <a href="http://www.nytimes.com/2007/12/30/business/30know.html?_r=2&amp;oref=slogin&amp;pagewanted=all&amp;oref=slogin">article in the New York Times</a>.&nbsp; As we become experts in a particular domain, our ability to innovate diminishes.<br />"Andrew S. Grove, the co-founder of Intel, put it well in 2005 when he told an interviewer from Fortune, “When everybody knows that something is so, it means that nobody knows nothin’.” In other words, it becomes nearly impossible to look beyond what you know and think outside the box you’ve built around yourself."</p>
<p>Reading the article, I couldn't help but think back to my own experiences with this same sort of issue.&nbsp; I blogged recently about two related ideas: how interface designers are <a href="http://blogs.pathf.com/uxd/2007/09/thinking-like-a.html">sometimes guilty of thinking as designers</a>--when they should be thinking as users, and about <a href="http://blogs.pathf.com/uxd/2007/12/on-the-benefits.html">the mixed bag that is competitive research</a>, which can limit the designers creative thinking by boxing them into predefined solutions.&nbsp; &nbsp;</p>
<p>Now I see that it's part of a larger problem of expertise and creativity.&nbsp; The more expertise one exhibits in a particular field, the harder it is to think creatively--to so called think 'outside the box', and the harder it is to imagine not knowing what you do.&nbsp; The problem affects whole companies, as a certain way of thinking becomes entrenched, and it gets harder for it to adapt to a changing landscape.&nbsp; The article cites the example of Eveready, the flashlight maker, who's powers-that-be couldn't imagine that their product could be effectively marketed to anyone other than men shopping at hardware stores.</p>
<p>According to Cynthia Barton Rabe, author of <a href="http://www.innovationkiller.com/">“Innovation Killer: How What We Know Limits What We Can Imagine — and What Smart Companies Are Doing About It,”</a> the solution for Eveready, as for any organization bogged down in its own expertise, is an infusion of outside thinking.&nbsp; Bringing the so called novices--the non expert users--into the discussion at the early stages of design, weather it be product or strategy design, opens the door for new ways of thinking that experts have long been insulated from.</p>
<p>&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>
<p>
<p class="poweredbyperformancing">Powered by <a href="http://scribefire.com/">ScribeFire</a>.</p></p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/01/the-curse-of-kn/">The Curse of Knowledge</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2006/07/innovation_thro/' rel='bookmark' title='Permanent Link: Innovation Through “Crowdsourcing”'>Innovation Through “Crowdsourcing”</a></li><li><a href='http://www.pathf.com/blogs/2006/08/2_approaches_to/' rel='bookmark' title='Permanent Link: 2 approaches to design&#8230;'>2 approaches to design&#8230;</a></li><li><a href='http://www.pathf.com/blogs/2007/11/dux2007-ubiqu/' rel='bookmark' title='Permanent Link: DUX2007 &#8211; Ubiquitous Computing'>DUX2007 &#8211; Ubiquitous Computing</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/01/the-curse-of-kn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design can be Used for Good and Bad</title>
		<link>http://www.pathf.com/blogs/2008/01/design-can-be-u/</link>
		<comments>http://www.pathf.com/blogs/2008/01/design-can-be-u/#comments</comments>
		<pubDate>Thu, 03 Jan 2008 21:49:32 +0000</pubDate>
		<dc:creator>Sholom Sandalow</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Interaction Design]]></category>
		<category><![CDATA[Requirements Visualization]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2008/01/design-can-be-u/</guid>
		<description><![CDATA[Every so often I'm rudely reminded that much of the information I get comes from a source who's goal is to sell rather than inform. It is those times that I'm also reminded of the critical role that design plays...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/01/design-can-be-u/">Design can be Used for Good and Bad</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/01/interface-desig/' rel='bookmark' title='Permanent Link: Stock ticker entry fields and usability'>Stock ticker entry fields and usability</a></li><li><a href='http://www.pathf.com/blogs/2007/02/ajax_and_design/' rel='bookmark' title='Permanent Link: Ajax and Design'>Ajax and Design</a></li><li><a href='http://www.pathf.com/blogs/2009/08/facebook-connect/' rel='bookmark' title='Permanent Link: Facebook Connect'>Facebook Connect</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Every so often I'm rudely reminded that much of the information I get comes from a source who's goal is to sell rather than inform.&nbsp; It is those times that I'm also reminded of the critical role that design plays in supporting the goals of the organization (wether they be to inform or to sell) by shaping user behavior.</p>
<p>Case in point.&nbsp; I use <a href="http://finance.yahoo.com">Yahoo Finance</a> to track my stock portfolio and stay financially abreast of the day.&nbsp;&nbsp; I choose Yahoo over the many others out there because I'm used to it.&nbsp; It has a simple interface and I know where everything is located.&nbsp; It also has great tools, and it aggregates information from many many other sources in one place, which I find invaluable.&nbsp; However I just recently noticed that Yahoo Finance is serving some text ads on the site now.&nbsp; I wouldn't otherwise be too bothered by them, but they've been designed for the express purpose of looking like real (un-sponsored) content.&nbsp; They're right up there on the right hand side of the page, occupying the top of one column in a three column layout.&nbsp; The ad titles are just about the same color as the headlines and links on the rest of the site.&nbsp; And while the other section titles are all orange and bold--designed to give structure to the page and let you know what section your in-- the only way you can tell that your reading ads is from the truly inconspicuous (light-grey on light blue, thin, all caps) 'Advertisement' header. &nbsp;</p>
<p>This really infuriates me, especially because it's a finance site, and I can't help but notice the content of the ads.&nbsp; For instance, right now I'm looking at the front page, from left to right I see a snapshot of the Dow's performance today, a headline saying 'Stocks mixed ahead of jobs report' and a couple of blurbs on 'Hottest China Stock' and '16 Hot Dividend Stocks'.&nbsp; Now I'm sure you can guess which ones are ads.&nbsp; And yet I can't help but see the ads and incorporate them into my understanding of the days financial news.&nbsp; They were designed to be scanned, and that's exactly the kind of information I need to be able to filter out when I'm scanning a page like this. </p>
<p>The fact that these ads persist is a clear indication that Yahoo is concerned less about an informed public and more about using its real estate to extract as much equity as possible.</p>
<p class="poweredbyperformancing">Powered by <a href="http://scribefire.com/">ScribeFire</a>.</p></p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2008/01/design-can-be-u/">Design can be Used for Good and Bad</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2008/01/interface-desig/' rel='bookmark' title='Permanent Link: Stock ticker entry fields and usability'>Stock ticker entry fields and usability</a></li><li><a href='http://www.pathf.com/blogs/2007/02/ajax_and_design/' rel='bookmark' title='Permanent Link: Ajax and Design'>Ajax and Design</a></li><li><a href='http://www.pathf.com/blogs/2009/08/facebook-connect/' rel='bookmark' title='Permanent Link: Facebook Connect'>Facebook Connect</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2008/01/design-can-be-u/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DUX2007 &#8211; Data Visualization</title>
		<link>http://www.pathf.com/blogs/2007/11/dux2007-data/</link>
		<comments>http://www.pathf.com/blogs/2007/11/dux2007-data/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 02:14:03 +0000</pubDate>
		<dc:creator>Alice Toth</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Information Architecture]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2007/11/dux2007-data/</guid>
		<description><![CDATA[Data visualization was touched upon a number of times throughout the DUX07 conference. In David Pescovitz’ keynote address on Monday, he mentioned that since the 1980s we’ve seen three waves of technology: PC Computing, communicating, and sensing. We’re now in...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2007/11/dux2007-data/">DUX2007 &#8211; Data Visualization</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/12/nice-list-data-visualization-tools/' rel='bookmark' title='Permanent Link: Nice List of Data Visualization Tools'>Nice List of Data Visualization Tools</a></li><li><a href='http://www.pathf.com/blogs/2007/11/dux2007-simpl/' rel='bookmark' title='Permanent Link: DUX2007 &#8211; Simplicity'>DUX2007 &#8211; Simplicity</a></li><li><a href='http://www.pathf.com/blogs/2007/11/dux2007-ubiqu/' rel='bookmark' title='Permanent Link: DUX2007 &#8211; Ubiquitous Computing'>DUX2007 &#8211; Ubiquitous Computing</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Data visualization was touched upon a number of times throughout the <a href="http://dux2007.org" target="_blank">DUX07</a> conference. </p>
<p>In <a href="http://dux2007.com/attend/speakers.php?list" target="_blank">David Pescovitz’</a> keynote address on Monday, he mentioned that since the 1980s we’ve seen three waves of technology: PC Computing, communicating, and sensing. We’re now in the fourth wave which is sense making -- how do we make sense of all the data that’s out there. How do we deal with search queries that return hundreds of thousand of lines of results. How do we start to make connections between the data. </p>
<p>One way we deal with sense making is through data visualization -- a concept which is starting to filter out beyond the research labs into the commercial space. Through data visualization, we can take huge sets of information and present them in such a way that it:</p>
<ul>
<li>allows us to immediately see how items are related to one another;</li>
<li>gives us a more immediate way to see patterns;</li>
<li>becomes a default to try and understand huge amounts of information.</li>
</ul>
<p>In addition to visualization, Pescovitz touched a bit on how we're using collective filtering to try and make sense of all this data. We turn to social networks we may trust, such as Digg, to take advantage of the filtering layer created by that network’s society. Anything to help us get a head start on parsing the data.</p>
<p>Later on in the conference, Nick Cawthon talked about aesthetics and efficiency in visualization of data. His talk referenced research he had done using different types of data visualization in order to determine what participants thought of the graphic (pretty or ugly) and whether or not it worked (they could complete a task such as finding a file). An interesting outcome was that the higher the user-rated aesthetic, the more reluctant the user was to abandon that particular data visualization. At a basic level, if the interactive graphic was perceived as “pretty”, the user was willing to spend a bit more time trying to learn how to use it.</p>
<p>Fascinating ideas and I know we're just scratching the surface of its potential.</p>
<p></p>
<p>Technorati Tags: <a rel="tag" href="http://technorati.com/tag/Design" class="performancingtags">Design</a>, <a rel="tag" href="http://technorati.com/tag/Information%20Architecture" class="performancingtags">Information Architecture</a>, <a rel="tag" href="http://technorati.com/tag/Usability" class="performancingtags">Usability</a>, <a rel="tag" href="http://technorati.com/tag/DUX07" class="performancingtags">DUX07</a></p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2007/11/dux2007-data/">DUX2007 &#8211; Data Visualization</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2009/12/nice-list-data-visualization-tools/' rel='bookmark' title='Permanent Link: Nice List of Data Visualization Tools'>Nice List of Data Visualization Tools</a></li><li><a href='http://www.pathf.com/blogs/2007/11/dux2007-simpl/' rel='bookmark' title='Permanent Link: DUX2007 &#8211; Simplicity'>DUX2007 &#8211; Simplicity</a></li><li><a href='http://www.pathf.com/blogs/2007/11/dux2007-ubiqu/' rel='bookmark' title='Permanent Link: DUX2007 &#8211; Ubiquitous Computing'>DUX2007 &#8211; Ubiquitous Computing</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2007/11/dux2007-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pimp my Webapp: Turning Web 1.0 into Web 2.0, Part 1</title>
		<link>http://www.pathf.com/blogs/2007/10/pimp-my-webapp/</link>
		<comments>http://www.pathf.com/blogs/2007/10/pimp-my-webapp/#comments</comments>
		<pubDate>Tue, 16 Oct 2007 17:54:29 +0000</pubDate>
		<dc:creator>Dietrich Kappe</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Ajax Development]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=224</guid>
		<description><![CDATA[Everyone wants the Web 2.0. But how to get there, especially if you have a dowdy old Web 1.0 application? Will I have to spend the annual GDP of a smallish Central American nation on the rewrite? There are three...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2007/10/pimp-my-webapp/">Pimp my Webapp: Turning Web 1.0 into Web 2.0, Part 1</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2006/07/application_wat-4/' rel='bookmark' title='Permanent Link: Application Watch &#8211; Domain Lookup with AJAX'>Application Watch &#8211; Domain Lookup with AJAX</a></li><li><a href='http://www.pathf.com/blogs/2006/10/that_giant_suck/' rel='bookmark' title='Permanent Link: That Giant Sucking Sound is Ajax Turning Your Site into an Application'>That Giant Sucking Sound is Ajax Turning Your Site into an Application</a></li><li><a href='http://www.pathf.com/blogs/2008/02/grails-and-json/' rel='bookmark' title='Permanent Link: Grails and JSONP: How Easy is That?'>Grails and JSONP: How Easy is That?</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Everyone wants the Web 2.0. But how to get there, especially if you have a dowdy old Web 1.0 application? Will I have to spend the annual GDP of a smallish Central American nation on the rewrite? There are three general approaches that evolved over the last year:</p>
<ol>
<li>The Christmas Tree Approach - decorate your Web 1.0 app with Ajax widgets and simple backend JSON or XML services. Pro: doesn't require major investment. Con: app still mostly suffers from the Web 1.0 downsides -- postbacks, CRUD, etc.</li>
<li>The Refrosting the Cake Approach - transform all of your views from HTML to JSON or XML. Develop a client side GUI that calls your applications controllers and views. Pro: doesn't require full rewrite. Con: control flow moves from server side to client side; won't take full advantage of RIA opportunities, such as direct manipulation or document-centric interfaces; really just a nice face on CRUD.</li>
<li>The From Scratch Approach - take the opportunity to rethink your application as something other than the web equivalent of a <a href="http://en.wikipedia.org/wiki/IBM_3270">green screen</a>. Imagine Photoshop or Word as a traditional webapp. Pro: unencumbered by the old system. Con: costly; you may lose your way in reinventing your app.</li>
</ol>
<p>I think approach #2, Refrosting the Cake, is actually quite appealing. You can make using that dowdy old webapp quite a bit more pleasant with a quick coat of Ajax. There was a really interesting <a href="http://www.theserverside.com/tt/articles/article.tss?l=AjaxandSpring" target="_blank">article</a> on this written by Brian Walsh back in July of 2006. It sort of got lost as a pure Tibco GI article, but it has much wider applicability. In it, Brian uses XStream to convert the views of a SpringMVC sample application from HTML to XML. He then uses Tibco GI to build a UI that talks to the controllers and views on the back end.</p>
<p>I used a similar approach to convert a dowdy old application -- <a href="http://www.mattsscripts.co.uk/mwhois.htm" target="_blank">mwhois</a> -- to Web 2.0. Instead of Tibco GI, I used GWT. And instead of XML, I used JSON.</p>
<p>The old application looked somewhat homely...</p>
<p><img src="http://blogs.pathf.com/agileajax/whois2.png" /><br />...and suffered from the kludgey flow and heavy postbacks typical of Web 1.0. I proceded to identify the different views and converted them (via mwhois' templates) into JSON.</p>
<p>
<div class="code-quote">
<pre>simple search: domain=agiledev&amp;ext=com

{ "isAvail" : false,  "domain" : "agiledev",  "ext" : "com",  "whoisServer" : "whois.crsnic.net" }

raw record: domain=french&amp;ext=biz&amp;show_raw=1

{ "domain" : "french",  "ext" : "biz",  "raw" : "Domain Name:                                 FRENCH.BIZ\nDomain ID:                                   D2708502-BIZ\nSponsoring Registrar:                        COMMUNI GAL COMMUNICATIONS LTD.\nSponsoring Registrar IANA ID:                418\nDomain Status:                               clientTransferProhibited\nRegistrant ID:                               GC683CO965021\nRegistrant Name:                             jamil akhtar\nRegistrant Address1:                         Regent House\nRegistrant Address2:                         24-25 Nutford Place\nRegistrant City:                             London\nRegistrant Postal Code:                      W1H 5YN\nRegistrant Country:                          Great Britain (UK)\nRegistrant Country Code:                     GB\nRegistrant Phone Number:                     +44.7729391052\nRegistrant Facsimile Number:                 +44.2075693152\nRegistrant Email:                            jamil@cityfinancialcorp.co.uk\nAdministrative Contact ID:                   GC683CO965021\nAdministrative Contact Name:                 jamil akhtar\nAdministrative Contact Address1:             Regent House\nAdministrative Contact Address2:             24-25 Nutford Place\nAdministrative Contact City:                 London\nAdministrative Contact Postal Code:          W1H 5YN\nAdministrative Contact Country:              Great Britain (UK)\nAdministrative Contact Country Code:         GB\nAdministrative Contact Phone Number:         +44.7729391052\nAdministrative Contact Facsimile Number:     +44.2075693152\nAdministrative Contact Email:                jamil@cityfinancialcorp.co.uk\nBilling Contact ID:                          GC683CO965021\nBilling Contact Name:                        jamil akhtar\nBilling Contact Address1:                    Regent House\nBilling Contact Address2:                    24-25 Nutford Place\nBilling Contact City:                        London\nBilling Contact Postal Code:                 W1H 5YN\nBilling Contact Country:                     Great Britain (UK)\nBilling Contact Country Code:                GB\nBilling Contact Phone Number:                +44.7729391052\nBilling Contact Facsimile Number:            +44.2075693152\nBilling Contact Email:                       jamil@cityfinancialcorp.co.uk\nTechnical Contact ID:                        GC683CO965021\nTechnical Contact Name:                      jamil akhtar\nTechnical Contact Address1:                  Regent House\nTechnical Contact Address2:                  24-25 Nutford Place\nTechnical Contact City:                      London\nTechnical Contact Postal Code:               W1H 5YN\nTechnical Contact Country:                   Great Britain (UK)\nTechnical Contact Country Code:              GB\nTechnical Contact Phone Number:              +44.7729391052\nTechnical Contact Facsimile Number:          +44.2075693152\nTechnical Contact Email:                     jamil@cityfinancialcorp.co.uk\nName Server:                                 DNS.INTER.NET.IL\nName Server:                                 NS.COMMUNIGAL.NET\nCreated by Registrar:                        COMMUNI GAL COMMUNICATIONS LTD.\nLast Updated by Registrar:                   COMMUNI GAL COMMUNICATIONS LTD.\nDomain Registration Date:                    Wed Mar 27 00:01:00 GMT 2002\nDomain Expiration Date:                      Wed Mar 26 23:59:59 GMT 2008\nDomain Last Updated Date:                    Mon Mar 12 16:25:34 GMT 2007\n\n&gt;&gt;&gt;&gt; Whois database was last updated on: Sun Oct 14 17:51:14 GMT 2007 &lt;&lt;&lt;&lt;\n\nNeuLevel, Inc., the Registry Operator for .BIZ, has collected this information\nfor the WHOIS database through an ICANN-Accredited Registrar. This information\nis provided to you for informational purposes only and is designed to assist\npersons in determining contents of a domain name registration record in the\nNeuLevel registry database. NeuLevel makes this information available to you\n\"as is\" and does not guarantee its accuracy. By submitting a WHOIS query, you\nagree that you will use this data only for lawful purposes and that, under no\ncircumstances will you use this data: (1) to allow, enable, or otherwise\nsupport the transmission of mass unsolicited, commercial advertising or\nsolicitations via direct mail, electronic mail, or by telephone; (2) in\ncontravention of any applicable data and privacy protection acts; or (3) to\nenable high volume, automated, electronic processes that apply to the registry\n(or its systems). Compilation, repackaging, dissemination, or other use of the\nWHOIS database in its entirety, or of a substantial portion thereof, is not\nallowed without NeuLevel's prior written permission. NeuLevel reserves the\nright to modify or change these conditions at any time without prior or\nsubsequent notification of any kind. By executing this query, in any manner\nwhatsoever, you agree to abide by these terms.\n\nNOTE: FAILURE TO LOCATE A RECORD IN THE WHOIS DATABASE IS NOT INDICATIVE\nOF THE AVAILABILITY OF A DOMAIN NAME.\n" }

global search: domain=agilesoftware&amp;do_global=1

{ "domain" : "agilesoftware",  "avail" : [{ "domain":"agilesoftware","ext":"biz" },{ "domain":"agilesoftware","ext":"be" }],  "unavail" : [{ "domain":"agilesoftware","ext":"com" },{ "domain":"agilesoftware","ext":"net" },{ "domain":"agilesoftware","ext":"org" },{ "domain":"agilesoftware","ext":"co.uk" },{ "domain":"agilesoftware","ext":"info" }] }

wizard search: do_wizard=1&amp;company=pathfinder&amp;keyword1=uxd&amp;keyword2=agile&amp;ext=com

{ "whoisServer" : "whois.crsnic.net",  "avail" : [{ "domain":"pathfinderuxd","ext":"com" },{ "domain":"pathfinder-uxd","ext":"com" },{ "domain":"uxdpathfinder","ext":"com" },{ "domain":"uxd-pathfinder","ext":"com" },{ "domain":"pathfinder-agile","ext":"com" },{ "domain":"agilepathfinder","ext":"com" },{ "domain":"agile-pathfinder","ext":"com" },{ "domain":"uxdagile","ext":"com" },{ "domain":"agileuxd","ext":"com" },{ "domain":"uxd-agile","ext":"com" },{ "domain":"agile-uxd","ext":"com" }],  "unavail" : [{ "domain":"pathfinder","ext":"com" },{ "domain":"pathfinderagile","ext":"com" },{ "domain":"uxd","ext":"com" },{ "domain":"agile","ext":"com" }] }
</pre>
</div>
<p>Then I wrote a simple, tabbed interface using <a href="http://code.google.com/p/google-web-toolkit/" target="_blank">GWT</a> and the <a href="http://blogs.pathf.com/agileajax/2007/09/mygwt-widget-li.html" target="_blank">MyGWT</a> widgets and slapped the two together.</p>
<p><img src="http://blogs.pathf.com/agileajax/whois.png" /></p>
<p>I'll have more details on the code details in part 2 of this article. For now, you can look at the <a href="http://labs.pathf.com/retool/mwhois/mwhois.cgi" target="_blank">old</a> and <a href="http://labs.pathf.com/retool/mwhois2/" target="_blank">new</a> interfaces.</p>
<p>Technorati Tags: <a class="performancingtags" href="http://technorati.com/tag/ajax" rel="tag">ajax</a>, <a class="performancingtags" href="http://technorati.com/tag/gwt" rel="tag">gwt</a>, <a class="performancingtags" href="http://technorati.com/tag/mygwt" rel="tag">mygwt</a>, <a class="performancingtags" href="http://technorati.com/tag/tibco%20gi" rel="tag">tibco gi</a>, <a class="performancingtags" href="http://technorati.com/tag/JSON" rel="tag">JSON</a>, <a class="performancingtags" href="http://technorati.com/tag/XML" rel="tag">XML</a>, <a class="performancingtags" href="http://technorati.com/tag/web20" rel="tag">web20</a></p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2007/10/pimp-my-webapp/">Pimp my Webapp: Turning Web 1.0 into Web 2.0, Part 1</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2006/07/application_wat-4/' rel='bookmark' title='Permanent Link: Application Watch &#8211; Domain Lookup with AJAX'>Application Watch &#8211; Domain Lookup with AJAX</a></li><li><a href='http://www.pathf.com/blogs/2006/10/that_giant_suck/' rel='bookmark' title='Permanent Link: That Giant Sucking Sound is Ajax Turning Your Site into an Application'>That Giant Sucking Sound is Ajax Turning Your Site into an Application</a></li><li><a href='http://www.pathf.com/blogs/2008/02/grails-and-json/' rel='bookmark' title='Permanent Link: Grails and JSONP: How Easy is That?'>Grails and JSONP: How Easy is That?</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2007/10/pimp-my-webapp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>YUI Bubbling Library: a seriously cool design pattern</title>
		<link>http://www.pathf.com/blogs/2007/09/yui-bubbling-li/</link>
		<comments>http://www.pathf.com/blogs/2007/09/yui-bubbling-li/#comments</comments>
		<pubDate>Wed, 19 Sep 2007 10:15:00 +0000</pubDate>
		<dc:creator>Brian Dillard</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Javascript Libraries]]></category>
		<category><![CDATA[Patterns]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/?p=246</guid>
		<description><![CDATA[Caridy Patino recently posted to the YUI Blog about his event-bubbling library, which uses the subscriber/publisher design pattern to abstract an entire webapp's event binding into its own unobtrusive behavioral layer. Instead of attaching events to individual DOM nodes using...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2007/09/yui-bubbling-li/">YUI Bubbling Library: a seriously cool design pattern</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2007/10/dom-methods-doc/' rel='bookmark' title='Permanent Link: DOM methods, <i>document.write</i> and the art of library design'>DOM methods, <i>document.write</i> and the art of library design</a></li><li><a href='http://www.pathf.com/blogs/2006/04/a_useful_resour/' rel='bookmark' title='Permanent Link: A Useful Resource: Ajax Pattern Wiki'>A Useful Resource: Ajax Pattern Wiki</a></li><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Caridy Patino recently posted to the <a href="http://yuiblog.com">YUI Blog</a> about his event-bubbling library, which uses the subscriber/publisher design pattern to abstract an entire webapp's event binding into its own unobtrusive behavioral layer. Instead of attaching events to individual DOM nodes using <em>addListener</em>, you intercept and process all events near the document root, then use CSS classes or other criteria to match up individual events with the correct handlers. In effect, you end up with a big, global switch statement for handling mouse clicks, mouseovers, keydowns and other events.</p>
<p>Patino, a respected contributor to the YUI mailing list, makes a strong case for the usefulness of his library on larger, more event-driven webapps. For one thing, it can reduce the overhead of handling IE memory leaks. For another, it can simplify the process of attaching custom JavaScript behaviors to dynamically loaded content. Best of all, it can be used to improve performance of really complex apps. </p>
<p>Of course, such an abstract approach isn't for every developer or every application. Patino is pretty frank about both the pros and cons of his approach for specific situations. Even if the actual technique isn't for you, though, the post is a fantastic primer on the intricacies of DOM events and the publisher/subscriber pattern.</p>
<ul>
<li><a href="http://yuiblog.com/blog/2007/09/13/bubbling-library-by-caridy/">Read the post</a></li>
<li><a href="http://bubbling-library.com/">Check out the library</a></li>
</ul>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2007/09/yui-bubbling-li/">YUI Bubbling Library: a seriously cool design pattern</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2007/10/dom-methods-doc/' rel='bookmark' title='Permanent Link: DOM methods, <i>document.write</i> and the art of library design'>DOM methods, <i>document.write</i> and the art of library design</a></li><li><a href='http://www.pathf.com/blogs/2006/04/a_useful_resour/' rel='bookmark' title='Permanent Link: A Useful Resource: Ajax Pattern Wiki'>A Useful Resource: Ajax Pattern Wiki</a></li><li><a href='http://www.pathf.com/blogs/2008/02/design-pattern-3/' rel='bookmark' title='Permanent Link: Design Pattern 1 &#8211; faded breadcrumbs'>Design Pattern 1 &#8211; faded breadcrumbs</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2007/09/yui-bubbling-li/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Chaos and Order</title>
		<link>http://www.pathf.com/blogs/2007/09/chaos-and-order/</link>
		<comments>http://www.pathf.com/blogs/2007/09/chaos-and-order/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 22:30:43 +0000</pubDate>
		<dc:creator>Sholom Sandalow</dc:creator>
				<category><![CDATA[User Experience Design]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Design Patterns]]></category>
		<category><![CDATA[User Research]]></category>

		<guid isPermaLink="false">http://www.pathf.com/blogs/2007/09/chaos-and-order/</guid>
		<description><![CDATA[The process of designing (guis/websites/apps what have you) can be very exciting, and ultimately, when a design goes well and achieves its purpose, it can be highly rewarding. But it's also a challenge. Every designer has their own set of...
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2007/09/chaos-and-order/">Chaos and Order</a></p>



Related posts:<ol><li><a href='http://www.pathf.com/blogs/2007/03/what_are_task_f/' rel='bookmark' title='Permanent Link: What are Task Flows?'>What are Task Flows?</a></li><li><a href='http://www.pathf.com/blogs/2007/03/user_task_flows/' rel='bookmark' title='Permanent Link: User Task Flows Help Developers:'>User Task Flows Help Developers:</a></li><li><a href='http://www.pathf.com/blogs/2008/04/use-a-task-flow/' rel='bookmark' title='Permanent Link: Use a Task Flow to Show “How do I ___?”'>Use a Task Flow to Show “How do I ___?”</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>The process of designing (guis/websites/apps what have you) can be very exciting, and ultimately, when a design goes well and achieves its purpose, it can be highly rewarding.&nbsp; But it's also a challenge.&nbsp; Every designer has their own set of struggles that they go through during the design process.</p>
<p>One of the things I struggle with most as a designer is the urge I have to make things consistent, or symmetrical.&nbsp; I prefer order over chaos, I'll admit.&nbsp; I constantly have to catch myself from spending too much physical and mental energy on removing what I see as chaos, and replacing it with structure, consistency, balance and symmetry.&nbsp; It's not that these aren't worthy goals, but my experience is that sometimes those characteristics aren't the key, or even an important element on a particular interface screen or widget.&nbsp; In fact, in many instances I have found that what I consider order is quite an undesirable solution, or at least, not what the doctor ordered. &nbsp;<br />By instinct I look at my work through a designer’s lens.&nbsp; It is a macro view.&nbsp; I see the overall structure of the interface.&nbsp; I slave over task flows and wireframes, structuring them and fine tuning them so they please my aesthetic and philosophical sensibilities.&nbsp; I judge them by their adherence to my design rules-symmetry, balance, structure, consistency. &nbsp;<br />But for the judges that matter, the users, the interface is simply a tool that they will use to accomplish a task (or set of tasks).&nbsp; They will judge its success not by any theoretical characteristics, but by how well it allows them to accomplish those tasks.&nbsp; They won’t look at the blue prints.&nbsp; They’ll never get a look at the task flows generated in the design process, nor would they have any desire to. &nbsp;<br />Internalizing this distinction--the difference between my view, and the user’s view--and embedding it into my design process is one of the challenges I face, and one of the determinants of a successful design. </p>
<p class="poweredbyperformancing">Powered by <a href="http://scribefire.com/">ScribeFire</a>.</p></p>
<p><hr>
<a href="http://www.pathf.com/">Pathfinder Development - creating innovative software that builds business value. </a>
<br/><br/><a href="http://www.pathf.com/blogs/2007/09/chaos-and-order/">Chaos and Order</a></p>


<p>Related posts:<ol><li><a href='http://www.pathf.com/blogs/2007/03/what_are_task_f/' rel='bookmark' title='Permanent Link: What are Task Flows?'>What are Task Flows?</a></li><li><a href='http://www.pathf.com/blogs/2007/03/user_task_flows/' rel='bookmark' title='Permanent Link: User Task Flows Help Developers:'>User Task Flows Help Developers:</a></li><li><a href='http://www.pathf.com/blogs/2008/04/use-a-task-flow/' rel='bookmark' title='Permanent Link: Use a Task Flow to Show “How do I ___?”'>Use a Task Flow to Show “How do I ___?”</a></li></ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.pathf.com/blogs/2007/09/chaos-and-order/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 2.380 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-03-20 02:12:52 -->
