<?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>No One Is Perfect &#187; Software Development</title>
	<atom:link href="http://watchitlater.com/blog/category/dev/feed/" rel="self" type="application/rss+xml" />
	<link>http://watchitlater.com/blog</link>
	<description>A reluctant foray into the world of blogging.</description>
	<lastBuildDate>Sun, 13 Jun 2010 03:35:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Manipulating collections with lambdaj</title>
		<link>http://watchitlater.com/blog/2010/06/manipulating-collections-with-lambdaj/</link>
		<comments>http://watchitlater.com/blog/2010/06/manipulating-collections-with-lambdaj/#comments</comments>
		<pubDate>Sun, 13 Jun 2010 03:23:14 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://watchitlater.com/blog/?p=212</guid>
		<description><![CDATA[My day-to-day work often consists of writing web applications that aggregate data from a number of sources. Corporate constraints frequently dictate that I cannot use languages that make crunching of collections easier so I am forced into an old-fashioned for-loop frenzy. Ugh.
On a recent java project my pairing buddy (Jules &#8211; thank you) suggested that [...]]]></description>
			<content:encoded><![CDATA[<p>My day-to-day work often consists of writing web applications that aggregate data from a number of sources. Corporate constraints frequently dictate that I cannot use languages that make crunching of collections easier so I am forced into an old-fashioned for-loop frenzy. Ugh.</p>
<p>On a recent java project my pairing buddy (Jules &#8211; thank you) suggested that we look at <a href="http://code.google.com/p/lambdaj/">lambdaj</a>. From the lamdbaj site: &#8220;lambdaj is a library that makes easier to address this issue by allowing to manipulate collections in a pseudo-functional and statically typed way&#8221;. The following examples are very contrived but I&#8217;m sure you&#8217;ve seen something like them:</p>
<p>Old school:</p>
<pre name="code" class="java:nogutter">
List&lt;Customer&gt; activeCustomers = new ArrayList&lt;Customer&gt;();
for (Customer customer : customers) {
  if (customer.isActive()) {
    activeCusomers.add(customer);
  }
}
List&lt;Account&gt; accounts = new ArrayList&lt;Account&gt;();
for (Customer customer : activeCustomers) {
  accounts.addAll(customer.getAccounts());
}
Map&lt;String, List&lt;Account&gt;&gt; groups = new HashMap&lt;String, List&lt;Account&gt;&gt;();
for (Account account : accounts) {
  String type = account.getType();
  List&lt;Account&gt; group = groups.get(type);
  if (group == null) {
    group = new ArrayList&lt;Account&gt;();
    groups.put(type, group);
  }
  group.add(account);
}
</pre>
<p>New hotness:</p>
<pre name="code" class="java:nogutter">
List&lt;Customer&gt; activeCustomers = select(customers, having(on(Customer.class).isActive(), equalTo(true)));
List&lt;Account&gt; accounts = flatten(extract(activeCustomers, on(Customer.class).getAccounts()));
Group&lt;Account&gt; groups = group(accounts, by(on(Account.class).getType()));
</pre>
<p>My verdict: lambdaj certainly lives up to its promises. Obviously the old-school java code will be faster but is it easier to write or more readable? You decide &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://watchitlater.com/blog/2010/06/manipulating-collections-with-lambdaj/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Test definitions for developers</title>
		<link>http://watchitlater.com/blog/2010/03/test-definitions-for-developers/</link>
		<comments>http://watchitlater.com/blog/2010/03/test-definitions-for-developers/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 03:53:02 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[Soap Box]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[acceptance]]></category>
		<category><![CDATA[definition]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[unit]]></category>

		<guid isPermaLink="false">http://watchitlater.com/blog/?p=201</guid>
		<description><![CDATA[One of the best descriptions of the hierarchy of tests that I have seen comes from &#8220;Growing Object-Oriented Software, Guided by Tests&#8221; by Steve Freeman and Nat Price.
1. Acceptance Tests: Does the whole system work?
2. Integration Tests: Does our code work against code we can&#8217;t change?
3. Unit Tests: Do our objects do the right thing, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the best descriptions of the hierarchy of tests that I have seen comes from &#8220;<a href="http://amzn.com/0321503627">Growing Object-Oriented Software, Guided by Tests</a>&#8221; by Steve Freeman and Nat Price.</p>
<p>1. <strong>Acceptance Tests</strong>: Does the whole system work?<br />
2. <strong>Integration Tests</strong>: Does our code work against code we can&#8217;t change?<br />
3. <strong>Unit Tests</strong>: Do our objects do the right thing, are they convenient to work with?</p>
<p>Can we now get on with some work, rather than discussing definitions ad nauseam?</p>
]]></content:encoded>
			<wfw:commentRss>http://watchitlater.com/blog/2010/03/test-definitions-for-developers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Post-Redirect-Get in Rails</title>
		<link>http://watchitlater.com/blog/2010/03/post-redirect-get-in-rails/</link>
		<comments>http://watchitlater.com/blog/2010/03/post-redirect-get-in-rails/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:06:28 +0000</pubDate>
		<dc:creator>Tom</dc:creator>
				<category><![CDATA[My Code]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[post-redirect-get]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[REST]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sass]]></category>

		<guid isPermaLink="false">http://watchitlater.com/blog/?p=182</guid>
		<description><![CDATA[For a while now I&#8217;ve been flying the flag for using a post-redirect-get design pattern when writing web applications. In my opinion the current crop of web frameworks still make it very easy to do the &#8220;bad&#8221; thing since to do PRG properly you need to think what kind of an interaction you want with [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now I&#8217;ve been flying the flag for using a <a href="http://en.wikipedia.org/wiki/Post/Redirect/Get">post-redirect-get</a> design pattern when writing web applications. In my opinion the current crop of web frameworks still make it very easy to do the &#8220;bad&#8221; thing since to do PRG properly you need to think what kind of an interaction you want with users and not cop out saying its technically very difficult in &lt;insert framework here&gt;. If you resort to ActiveX controls, popups without navigation bars and/or weird javascript hacks to stop users from clicking refresh or back buttons then perhaps you should have written a better web application.</p>
<p>Whenever I play with Rails, or for that matter any other web framework, I get stuck on trying to find a problem to solve (or a set of requirements). Fortunately the <a href="http://pragprog.com/titles/rails3/agile-web-development-with-rails-third-edition">Agile Development with Rails</a> book from the Pragmatic Programmers has a nice little bookstore application that I can develop iteratively. I&#8217;ve put my latest adaptation of their depot application to use post-redirect-get (even works with ActiveResource scaffolds), UUIDs as ActiveRecord primary keys, HAML, SASS and RSpec on <a href="http://github.com/tomcz/pragprog-depot-prg">GitHub</a>. Feedback is always welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://watchitlater.com/blog/2010/03/post-redirect-get-in-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
