<?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>Pragmatic Coder &#187; Software Engineering</title>
	<atom:link href="http://www.richardnichols.net/category/software-engineering/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.richardnichols.net</link>
	<description>The blog of Richard Nichols.</description>
	<lastBuildDate>Sun, 07 Mar 2010 10:06:43 +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>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</title>
		<link>http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/</link>
		<comments>http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 10:04:37 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[app-engine]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=305</guid>
		<description><![CDATA[Just a quick tip &#8211; generally with Wicket we want to supply our application with a way to choose between &#8220;Development&#8221; vs. &#8220;Deployment&#8221; mode automatically, so that we can get stack traces etc. during development and disable development features for deployment. Google App Engine sets a convenient JVM property to enable this -

class MyWicketApplication extends [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/11/announcing-visural-wicket/' rel='bookmark' title='Permanent Link: Announcing &#8211; visural-wicket'>Announcing &#8211; visural-wicket</a></li>
<li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Just a quick tip &#8211; generally with Wicket we want to supply our application with a way to choose between &#8220;Development&#8221; vs. &#8220;Deployment&#8221; mode automatically, so that we can get stack traces etc. during development and disable development features for deployment. Google App Engine sets a convenient JVM property to enable this -</p>
<pre name="code" class="java">
class MyWicketApplication extends Application {
   .....
    private boolean isProd =
        "Production".equalsIgnoreCase(
            System.getProperty("com.google.appengine.runtime.environment"));

    @Override
    public String getConfigurationType() {
        return (isProd ? "DEPLOYMENT" : "DEVELOPMENT");
    }
}
</pre>
<p>Bam &#8211; Wickety GAE love!</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/11/announcing-visural-wicket/' rel='bookmark' title='Permanent Link: Announcing &#8211; visural-wicket'>Announcing &#8211; visural-wicket</a></li>
<li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>visural-wicket 0.5 released &#8211; ready for action!</title>
		<link>http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/</link>
		<comments>http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 10:40:12 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[releases]]></category>
		<category><![CDATA[visural-wicket]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=302</guid>
		<description><![CDATA[I&#8217;ve been working hard the past couple of weeks on getting the visural-wicket open source project I started ready for wider use. I really think there is some cool and useful stuff in this project that the Wicket community could benefit from, so I&#8217;ve worked very hard on getting the project into a fairly mature [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/11/announcing-visural-wicket/' rel='bookmark' title='Permanent Link: Announcing &#8211; visural-wicket'>Announcing &#8211; visural-wicket</a></li>
<li><a href='http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/' rel='bookmark' title='Permanent Link: Wicket On Google App Engine (GAE) &#8211; Deployment Configuration'>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</a></li>
<li><a href='http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/' rel='bookmark' title='Permanent Link: My &#8220;utility belt&#8221; now open-sourced&#8230;'>My &#8220;utility belt&#8221; now open-sourced&#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working hard the past couple of weeks on getting the <a href="http://code.google.com/p/visural-wicket/">visural-wicket</a> open source project I started ready for wider use. I really think there is some cool and useful stuff in this project that the Wicket community could benefit from, so I&#8217;ve worked very hard on getting the project into a fairly mature state for release.</p>
<ul>
<li>I&#8217;ve added Javadocs to the source for all the major pieces of functionality</li>
<li>I&#8217;ve created an example application which demos all the key features and how to use them</li>
<li>The example application is deployed<a href="http://visural-wicket-examples.appspot.com/"> LIVE on Google App Engine</a></li>
<li>I&#8217;ve done a lot of testing on each component across all the major browsers</li>
<li>Lots of bug-fixes and corner cases fixed</li>
<li>Some reconsideration and tweaking of the API to reduce the likelihood of future changes as much as possible</li>
</ul>
<p>Anyhow &#8211; it&#8217;s all up for download at the <a href="http://code.google.com/p/visural-wicket/">visural-wicket project page</a>. Comments and feedback and welcome, via this blog, or the<a href="http://groups.google.com/group/visural-wicket"> discussion group.</a></p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/11/announcing-visural-wicket/' rel='bookmark' title='Permanent Link: Announcing &#8211; visural-wicket'>Announcing &#8211; visural-wicket</a></li>
<li><a href='http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/' rel='bookmark' title='Permanent Link: Wicket On Google App Engine (GAE) &#8211; Deployment Configuration'>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</a></li>
<li><a href='http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/' rel='bookmark' title='Permanent Link: My &#8220;utility belt&#8221; now open-sourced&#8230;'>My &#8220;utility belt&#8221; now open-sourced&#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Simple Guide To Sub-reports in JasperReports / iReport</title>
		<link>http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/</link>
		<comments>http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 01:51:22 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[jasperreports]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=267</guid>
		<description><![CDATA[Reporting tools&#8230; why is it so hard??
It seems like it&#8217;s practically a requirement that all business reporting tools be difficult to learn, use and work with. JasperReports / iReport is no different. Don&#8217;t get me wrong it&#8217;s a good solution to a certain kind of problem (and it&#8217;s free and open source which doesn&#8217;t hurt), [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/' rel='bookmark' title='Permanent Link: Wicket On Google App Engine (GAE) &#8211; Deployment Configuration'>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</a></li>
<li><a href='http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/' rel='bookmark' title='Permanent Link: NetBeans 6.7 Broke My Parameterized Tests'>NetBeans 6.7 Broke My Parameterized Tests</a></li>
<li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Reporting tools&#8230; why is it so hard??</p>
<p>It seems like it&#8217;s practically a requirement that all business reporting tools be difficult to learn, use and work with. JasperReports / iReport is no different. Don&#8217;t get me wrong it&#8217;s a good solution to a certain kind of problem (and it&#8217;s free and open source which doesn&#8217;t hurt), but the iReport UI is (and I&#8217;ll try to be kind) <em>utilitarian </em>at best.</p>
<p>Anyhow, to do any non-trivial report with iReport, you&#8217;ll probably need to use sub-reports, which are not very clearly documented as to how the hell they work.</p>
<p>I&#8217;ll be talking strictly about Java-bean collection data sources for this article, so you will need to translate if you are doing direct SQL queries or something else.</p>
<p>The Java-bean data source is nice because we can utilise our existing domain layer in order to create our report, rather than replicating the same logistics in SQL (or worse &#8211; stored procedures) and thereby having two places to update when requirements change.</p>
<p>To easily understand how sub-reports work, we need to understand how JasperReports works in general.</p>
<p>JasperReports are stored in XML files (JRXML) &#8211; if you&#8217;ve created any report you&#8217;d be familiar with these files. These XML files are translated to Java source code by JasperReports, and then compiled into regular Java CLASS files, which are executable by the Jasper engine. You could say that Jasper compiles the JRXML files into Java, and then Java will compile these into byte code.</p>
<p><em>When you execute a report you are essentially executing Java code. </em>Keep this in mind when filling out expression fields in your report, and things will start to make more sense.</p>
<p>Generally you use a sub-report in a situation where you have a two or more child lists of data relating to a single parent element. A common use case would be a report with multiple details bands of different types. I say &#8220;different types&#8221;, because if you have nested children that relate to the same data set, then generally you can achieve formatting using groups with breaking on certain fields in the data set. Things get complicated though where you have one big report, which has multiple unrelated data sets inside it.</p>
<p>To avoid getting too meta &#8211; here&#8217;s a concrete example&#8230;</p>
<p><a href="http://www.richardnichols.net/wp-content/uploads/2010/02/examplefinal.jpg"><img class="aligncenter size-medium wp-image-272" title="Example Report" src="http://www.richardnichols.net/wp-content/uploads/2010/02/examplefinal-300x228.jpg" alt="" width="300" height="228" /></a></p>
<p>This report has a single main detail band (contact details &#8211; first and last names) and two sub-detail bands for each contact &#8211; addresses and phone numbers.</p>
<p>In Jasper we need to use two sub-reports to implement this. But before we get too far, let&#8217;s look at how we would create Javabeans to store this data.</p>
<p>The addresses:</p>
<pre name="code" class="java">
package com.visural.report;

public class AddressBean {

    private String type;
    private String address;

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
</pre>
<p>The phone numbers:</p>
<pre name="code" class="java">
package com.visural.report;

public class PhoneBean {

    private String type;
    private String number;

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
</pre>
<p>And the contact (parent) bean:</p>
<pre name="code" class="java">
package com.visural.report;

import java.util.List;

public class ContactBean {

    private String firstName;
    private String lastName;
    private List&lt;AddressBean&gt; addresses;
    private List&lt;PhoneBean&gt; phones;

    public List&lt;AddressBean&gt; getAddresses() {
        return addresses;
    }

    public void setAddresses(List&lt;AddressBean&gt; addresses) {
        this.addresses = addresses;
    }

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    public List&lt;PhoneBean&gt; getPhones() {
        return phones;
    }

    public void setPhones(List&lt;PhoneBean&gt; phones) {
        this.phones = phones;
    }
}
</pre>
<p>Finally, we need a test data source to use in developing our report. Here&#8217;s the factory for the report pictured earlier&#8230;</p>
<pre name="code" class="java">
package com.visural.report;

import java.util.Arrays;
import java.util.List;

public class ContactFactory {

    public static List&lt;ContactBean&gt; create() {
        ContactBean stub = new ContactBean();
        stub.setFirstName("John");
        stub.setLastName("Smith");

        AddressBean address1 = new AddressBean();
        address1.setType("Home");
        address1.setAddress("123 Fake St\nFaketown\nFK 12345");
        AddressBean address2 = new AddressBean();
        address2.setType("Work");
        address2.setAddress("321 Bogus St\nFaketown\nFK 12345");
        stub.setAddresses(Arrays.asList(address1, address2));

        PhoneBean phone1 = new PhoneBean();
        phone1.setType("Home");
        phone1.setNumber("03 9876 1234");
        PhoneBean phone2 = new PhoneBean();
        phone2.setType("Work");
        phone2.setNumber("03 1234 9876");
        PhoneBean phone3 = new PhoneBean();
        phone3.setType("Mobile");
        phone3.setNumber("0432 123 456");
        stub.setPhones(Arrays.asList(phone1, phone2, phone3));

        return Arrays.asList(stub);
    }
}
</pre>
<p>The thing to notice here is that we have modelled the Javabeans exactly as we would if they were being used for some other purpose, i.e. we haven&#8217;t done anything special to make them usable in JasperReports / iReport.</p>
<p>In Jasper we configure a Javabeans data source that is created from a Collection, using our ContactFactory.create() method. We then add fields as follows, and create our report layout:</p>
<p><a href="http://www.richardnichols.net/wp-content/uploads/2010/02/reportoutline.jpg"><img src="http://www.richardnichols.net/wp-content/uploads/2010/02/reportoutline-300x196.jpg" alt="" title="Report Outline" width="300" height="196" class="aligncenter size-medium wp-image-277" /></a></p>
<p>Note that the field names correspond to the Javabean property names. </p>
<p><strong>Now for the important part.</strong> We then need to set the data source on the sub-report&#8217;s properties:</p>
<p><a href="http://www.richardnichols.net/wp-content/uploads/2010/02/datasource1.jpg"><img src="http://www.richardnichols.net/wp-content/uploads/2010/02/datasource1-300x108.jpg" alt="" title="datasource1" width="300" height="108" class="aligncenter size-medium wp-image-278" /></a></p>
<p><a href="http://www.richardnichols.net/wp-content/uploads/2010/02/datasource2.jpg"><img src="http://www.richardnichols.net/wp-content/uploads/2010/02/datasource2-300x103.jpg" alt="" title="Data source 2" width="300" height="103" class="aligncenter size-medium wp-image-279" /></a></p>
<p>So we can just use an &#8220;data source expression&#8221; as our connection for the sub-report, and for the expression we create a data source on the fly using our collection of java beans from our current data source&#8217;s &#8220;addresses&#8221; and &#8220;phones&#8221; fields. &#8220;new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource(datasource.getPhones())&#8221; is the Java code we would write if we were to create a Javabean data source in our regular Java code. JasperReports will replace $F{phones} with &#8220;datasource.getPhones()&#8221; (or its equivalent) as part of it&#8217;s JRXML to Java compilation process.</p>
<p>The rest is simple; our sub-reports define fields that match the AddressBean and PhoneBean properties:</p>
<p><a href="http://www.richardnichols.net/wp-content/uploads/2010/02/addressoutline.jpg"><img src="http://www.richardnichols.net/wp-content/uploads/2010/02/addressoutline-300x138.jpg" alt="" title="addressoutline" width="300" height="138" class="aligncenter size-medium wp-image-280" /></a></p>
<p><a href="http://www.richardnichols.net/wp-content/uploads/2010/02/phonesoutline.jpg"><img src="http://www.richardnichols.net/wp-content/uploads/2010/02/phonesoutline-300x145.jpg" alt="" title="phonesoutline" width="300" height="145" class="aligncenter size-medium wp-image-281" /></a></p>
<p>With all that in mind, it really is a case of &#8220;it&#8217;s simple when you know how&#8221;, but be that as it may, I couldn&#8217;t find a concise description of how to do this in my googling. Hopefully this post will fill that gap. Perhaps everyone is still writing SQL-based reports against a single database? <img src='http://www.richardnichols.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I don&#8217;t know, but using Javabeans is a nice flexible alternative to use SQL-based reports that gives you a lot of options in the long term.</p>
<p>If you&#8217;re still confused you can download the above code, and the JRXML reports in a <a href='http://www.richardnichols.net/wp-content/uploads/2010/02/ReportDemo.zip'>Netbeans 6 project here</a>.</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/' rel='bookmark' title='Permanent Link: Wicket On Google App Engine (GAE) &#8211; Deployment Configuration'>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</a></li>
<li><a href='http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/' rel='bookmark' title='Permanent Link: NetBeans 6.7 Broke My Parameterized Tests'>NetBeans 6.7 Broke My Parameterized Tests</a></li>
<li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The year that was&#8230;</title>
		<link>http://www.richardnichols.net/2009/12/the-year-that-was/</link>
		<comments>http://www.richardnichols.net/2009/12/the-year-that-was/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 04:18:43 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Software Engineering]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=251</guid>
		<description><![CDATA[Since I&#8217;ve been post-slack the last month or two, I thought I&#8217;d do a retrospective post on last year, with respect to code and this blog.
The last few months have been dominated with getting married, home maintenance and Christmas preparations, and so I&#8217;ve had little time for much else. I did manage to fit a [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/11/announcing-visural-wicket/' rel='bookmark' title='Permanent Link: Announcing &#8211; visural-wicket'>Announcing &#8211; visural-wicket</a></li>
<li><a href='http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/' rel='bookmark' title='Permanent Link: My &#8220;utility belt&#8221; now open-sourced&#8230;'>My &#8220;utility belt&#8221; now open-sourced&#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.richardnichols.net/wp-content/uploads/2009/07/photo_3780_20090122.jpg"><img class="alignright size-thumbnail wp-image-68" title="Wine Glasses (FreeDigitalPhotos.net)" src="http://www.richardnichols.net/wp-content/uploads/2009/07/photo_3780_20090122-150x150.jpg" alt="" width="150" height="150" /></a>Since I&#8217;ve been post-slack the last month or two, I thought I&#8217;d do a retrospective post on last year, with respect to code and this blog.</p>
<p>The last few months have been dominated with getting married, home maintenance and Christmas preparations, and so I&#8217;ve had little time for much else. I did manage to fit a much needed holiday in there though, and I&#8217;m hoping to hit 2010 with a renewed sense of energy.</p>
<p>That said, I did start the <a href="http://code.google.com/p/visural-wicket/">visural-wicket</a> project not too long ago, and that is where much of my open-source energy has gone of late. The project is being developed in my spare time, largely to support the application I&#8217;m creating in my work time, but with a view of becoming a key dependency for open-review, an as yet unannounced project I started a while back, but then put on the back-burner for a number of reasons (time, design considerations, etc).</p>
<p>Once I&#8217;ve fleshed out a few more of the &#8220;must-have&#8221; components in visural-wicket, I will start to push for feedback and co-contributors, should the reception be positive.</p>
<p>I also open-sourced my <a href="http://code.google.com/p/visural-common/">visural-common</a> code, which forced me to do a clean-up and clear-out of some stuff which had been hanging around in my source tree for far too long.</p>
<p>At work, things have really be head-down, bum-up and WORK for the month or two, so I haven&#8217;t had the time or inclination to post any little &#8220;techy tid-bits&#8221; on the blog as a result. What I am considering doing in a short while though, is to put together a Wicket training series as a series of blog articles, as I think that would be valuable for the community and an interesting exercise for myself.</p>
<p>Anyhow, I&#8217;m rambling, so here&#8217;s to a great 2010! <img src='http://www.richardnichols.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/11/announcing-visural-wicket/' rel='bookmark' title='Permanent Link: Announcing &#8211; visural-wicket'>Announcing &#8211; visural-wicket</a></li>
<li><a href='http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/' rel='bookmark' title='Permanent Link: My &#8220;utility belt&#8221; now open-sourced&#8230;'>My &#8220;utility belt&#8221; now open-sourced&#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/12/the-year-that-was/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My &#8220;utility belt&#8221; now open-sourced&#8230;</title>
		<link>http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/</link>
		<comments>http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 13:00:48 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[open-source]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=236</guid>
		<description><![CDATA[Most programmers over the course of their careers accumulate a &#8220;utility belt&#8221; of sorts.
Well I just open-sourced mine &#8211; http://code.google.com/p/visural-common/
Primarily this is to support visural-wicket and another open-source project I&#8217;m working on a little. Also, I end up rewriting this stuff at pretty much every job in some form or other. So if this code [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/11/announcing-visural-wicket/' rel='bookmark' title='Permanent Link: Announcing &#8211; visural-wicket'>Announcing &#8211; visural-wicket</a></li>
<li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/09/markdown-doclet-updated-to-v2/' rel='bookmark' title='Permanent Link: markdown-doclet Updated to v2'>markdown-doclet Updated to v2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Most programmers over the course of their careers accumulate a &#8220;utility belt&#8221; of sorts.</p>
<p>Well I just open-sourced mine &#8211; <a href="http://code.google.com/p/visural-common/">http://code.google.com/p/visural-common/</a></p>
<p>Primarily this is to support <a href="http://code.google.com/p/visural-wicket/">visural-wicket </a>and another open-source project I&#8217;m working on a little. Also, I end up rewriting this stuff at pretty much every job in some form or other. So if this code is open-source I won&#8217;t have to write it again &#8211; at least in theory <img src='http://www.richardnichols.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>My &#8220;belt&#8221; used to be a lot bigger, but there&#8217;s more and more other open implementations of these sorts of things which I&#8217;m really happy with, and happy not to have to maintain by own version of. This is stuff that&#8217;s left over, and for a large part is just part of my style of code writing.</p>
<p>There&#8217;s not much of great interest in there &#8211; I personally think some of the small &#8220;helper&#8221; methods that are in there can make code read very elegantly, but hey, this is my &#8220;utility belt&#8221;, so I&#8217;m biased.</p>
<p>In any case &#8211; my reasons for open-sourcing this are purely pragmatic, but take a look through and take out the stuff you like.</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/11/announcing-visural-wicket/' rel='bookmark' title='Permanent Link: Announcing &#8211; visural-wicket'>Announcing &#8211; visural-wicket</a></li>
<li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/09/markdown-doclet-updated-to-v2/' rel='bookmark' title='Permanent Link: markdown-doclet Updated to v2'>markdown-doclet Updated to v2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing &#8211; visural-wicket</title>
		<link>http://www.richardnichols.net/2009/11/announcing-visural-wicket/</link>
		<comments>http://www.richardnichols.net/2009/11/announcing-visural-wicket/#comments</comments>
		<pubDate>Sat, 14 Nov 2009 10:55:17 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=220</guid>
		<description><![CDATA[I&#8217;ve not posted a new blog entry for a few weeks. Mainly because I&#8217;ve just been too damn busy, with work and with wedding stuff.
At work we&#8217;ve taken the plunge with Apache Wicket, which I have to say,

is a fantastic web framework. I&#8217;ve used a lot of them over the past few years and Wicket [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/' rel='bookmark' title='Permanent Link: My &#8220;utility belt&#8221; now open-sourced&#8230;'>My &#8220;utility belt&#8221; now open-sourced&#8230;</a></li>
<li><a href='http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/' rel='bookmark' title='Permanent Link: Wicket On Google App Engine (GAE) &#8211; Deployment Configuration'>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve not posted a new blog entry for a few weeks. Mainly because I&#8217;ve just been too damn busy, with work and with wedding stuff.</p>
<p>At work we&#8217;ve taken the plunge with <a href="http://wicket.apache.org/">Apache Wicket</a>, which I have to say,</p>
<p><img class="size-thumbnail wp-image-227 alignright" title="http://commons.wikimedia.org/wiki/File:Wicket_being_hit_by_a_ball.jpg" src="http://www.richardnichols.net/wp-content/uploads/2009/11/Wicket_being_hit_by_a_ball-150x150.jpg" alt="http://commons.wikimedia.org/wiki/File:Wicket_being_hit_by_a_ball.jpg" width="150" height="150" /></p>
<p>is a fantastic web framework. I&#8217;ve used a lot of them over the past few years and Wicket is by far, the best I&#8217;ve used (including non-Java frameworks such as Rails &#8211; just my opinion). Wicket&#8217;s component based, approach and it&#8217;s abstraction of the request-response cycle (e.g. handling of AJAX) is extremely elegant, without going to the extremes that frameworks such as <a href="http://code.google.com/webtoolkit/">GWT </a>go to.</p>
<p>Something I have found surprising though, is that there doesn&#8217;t seem to be much of a Wicket component marketplace or community. I don&#8217;t know whether it&#8217;s complexity of building them, whether everyone is rolling their own, or whether everyone is pretty much happy with what&#8217;s there out of the box, but for my own needs I&#8217;ve started an open-source project to create the Wicket components I wish I had, and a few Wicket related utility classes etc.</p>
<p><a href="http://code.google.com/p/visural-wicket/">http://code.google.com/p/visural-wicket/</a></p>
<p><strong>visural-wicket</strong> is licensed under the Apache 2.0 license and is 100% free and open-source. The only work that I&#8217;ve done thus far is a new type of &#8220;drop down box&#8221; component, similar in some ways to the <a href="http://developer.yahoo.com/yui/autocomplete/">YUI Auto-complete</a> control. Unlike that control though it has a mode which requires a list value to be selected (like a regular drop down box) and you may disable filtering (auto-complete) completely if you&#8217;d like. In essence it&#8217;s more of a drop down component and not really an auto-complete. I have some other neat features planned for this component too, such as the ability to exclusively select values from the source lists when you use multiple instances of the drop down on a single page.</p>
<p>The project is currently in alpha stages of development, however the drop down component is currently functional, if a bit buggy.</p>
<p>I have some other major items I want to contribute to this project, which I will discuss once I have a solid design to talk about.</p>
<p>Definitely interested in comments, feedback or collaborators on <em>visural-wicket</em>&#8230;.</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/11/my-utility-belt-now-open-sourced/' rel='bookmark' title='Permanent Link: My &#8220;utility belt&#8221; now open-sourced&#8230;'>My &#8220;utility belt&#8221; now open-sourced&#8230;</a></li>
<li><a href='http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/' rel='bookmark' title='Permanent Link: Wicket On Google App Engine (GAE) &#8211; Deployment Configuration'>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/11/announcing-visural-wicket/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>1 Minute Guide &#8211; Installing Redmine on Windows</title>
		<link>http://www.richardnichols.net/2009/09/1-minute-guide-installing-redmine-on-windows/</link>
		<comments>http://www.richardnichols.net/2009/09/1-minute-guide-installing-redmine-on-windows/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 08:30:04 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[guides]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=206</guid>
		<description><![CDATA[Redmine is a fantastic Issue Tracking (defects and enhancements) web application written in Ruby on Rails. I&#8217;ve been using it for quite a while, and it&#8217;s a good looking, simple but powerful defect management tool with a bunch of value-add features like document repositories, wikis, roadmap and time tracking.
Rails apps can be a bit mysterious [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2010/01/ebooks-drm-fail/' rel='bookmark' title='Permanent Link: eBooks + DRM = Fail'>eBooks + DRM = Fail</a></li>
<li><a href='http://www.richardnichols.net/2009/09/the-results-are-in/' rel='bookmark' title='Permanent Link: The Results Are In&#8230;'>The Results Are In&#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.redmine.org/" target="_blank">Redmine</a> is a fantastic Issue Tracking (defects and enhancements) web application written in Ruby on Rails. I&#8217;ve been using it for quite a while, and it&#8217;s a good looking, simple but powerful defect management tool with a bunch of value-add features like document repositories, wikis, roadmap and time tracking.</p>
<p>Rails apps can be a bit mysterious to deploy on Windows server&#8217;s however, so here is a 1 minute guide to installing Redmine on Ruby on Rails on Windows! <img src='http://www.richardnichols.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You will need an Internet connected Windows PC or server to get started. If you don&#8217;t have an Internet-enabled PC, you can do the install on an Internet connected PC and move the Ruby folder tree to your target machine, but I&#8217;ll assume you live in the 21st century and do have Internet connectivity.</p>
<ol>
<li>Download version <a href="http://rubyinstaller.rubyforge.org/" target="_blank">1.8 of Ruby</a> &#8211; the link is to the &#8220;all-in-one&#8221; installer for Windows. You need version 1.8, not 1.9 as Redmine only works on 1.8 right now.</li>
<li>Set up so Ruby&#8217;s &#8220;bin&#8221; folder is in your system or command prompt path. You should be able to type &#8220;ruby&#8221; at the command prompt and not get any &#8220;file not found&#8221; errors.</li>
<li>Create yourself some sort of &#8220;Ruby apps&#8221; folder and open a command prompt at that location, e.g. C:\Ruby\Apps or something</li>
<li>At the command prompt: &#8220;<em>gem install rails</em>&#8220;</li>
<li>At the command prompt: &#8220;<em>gem install mongrel</em>&#8220;</li>
<li>Download the latest stable version of <a href="http://www.redmine.org/" target="_blank">Redmine </a>and unzip into a subfolder of your Ruby apps dir (e.g. C:\Ruby\Apps\Redmine)</li>
<li>Configure the <em>database.yml </em>for Redmine to point to a database for your Redmine instance to use (I&#8217;ll leave that up to you)</li>
<li>In the Redmine folder, at the command prompt: &#8220;<em>rake db:migrate</em>&#8220;</li>
<li>If you&#8217;re using Redmine v0.8.7 or above, at the command prompt: <em>&#8220;rake generate_session_store&#8221;</em></li>
<li>Test your Redmine installation is working, at the command prompt: &#8220;<em>mongrel_rails start</em>&#8220;, then hit <em>http://localhost:[port]/</em> in your browser where <em>[port]</em> is the port Mongrel started with. Kill the server with Ctrl+C once you&#8217;ve verified Redmine is working.</li>
<li>At the command prompt: &#8220;<em>gem install win32-service</em>&#8220;</li>
<li>At the command prompt: &#8220;<em>gem install mongrel_service</em>&#8220;</li>
<li>Install Redmine as a Windows service, at the command prompt: &#8220;<em>mongrel_rails service::install -N Redmine -c [your redmine folder] -p [portno] -e production</em>&#8220;, replacing <em>[your redmine folder]</em> with the full path to the Redmine folder in the filesystem, and the <em>[portno]</em> being the port you&#8217;d like redmine to server on, e.g. 80 for standard http port 80.</li>
</ol>
<p>If at any time you wish to remove the Redmine windows service (uninstall), you can enter &#8220;<em>mongrel_rails service::remove -N Redmine</em>&#8221; at the command prompt to remove it.</p>
<p>If you get an error at any one of the steps above, well, you&#8217;re going to have to go hit up Google for some solutions. But from a fresh install the above should work just fine &#8211; happy mining&#8230;</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2010/01/ebooks-drm-fail/' rel='bookmark' title='Permanent Link: eBooks + DRM = Fail'>eBooks + DRM = Fail</a></li>
<li><a href='http://www.richardnichols.net/2009/09/the-results-are-in/' rel='bookmark' title='Permanent Link: The Results Are In&#8230;'>The Results Are In&#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/09/1-minute-guide-installing-redmine-on-windows/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>markdown-doclet Updated to v2</title>
		<link>http://www.richardnichols.net/2009/09/markdown-doclet-updated-to-v2/</link>
		<comments>http://www.richardnichols.net/2009/09/markdown-doclet-updated-to-v2/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 08:19:30 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[doclet]]></category>
		<category><![CDATA[javadoc]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[open-source]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=202</guid>
		<description><![CDATA[I&#8217;ve just posted a new release of markdown-doclet on google code.
This version fixes the {@link ClassNameEtc} Javadoc notation, which was broken due to the case-sensitivity of the markdown library.
It is highly recommended to upgrade to the new version  


Related posts:Markdown Doclet for Javadoc
visural-wicket 0.5 released &#8211; ready for action!
Automatic release packaging w/ version numbers [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/06/markdown-doclet-for-javadoc/' rel='bookmark' title='Permanent Link: Markdown Doclet for Javadoc'>Markdown Doclet for Javadoc</a></li>
<li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/11/automatic-release-packaging-w-version-numbers-for-netbeans-java-projects/' rel='bookmark' title='Permanent Link: Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;'>Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just posted a new release of <a href="http://code.google.com/p/markdown-doclet/">markdown-doclet</a> on google code.</p>
<p>This version fixes the <code>{@link ClassNameEtc}</code> Javadoc notation, which was broken due to the case-sensitivity of the markdown library.</p>
<p>It is highly recommended to upgrade to the new version <img src='http://www.richardnichols.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/06/markdown-doclet-for-javadoc/' rel='bookmark' title='Permanent Link: Markdown Doclet for Javadoc'>Markdown Doclet for Javadoc</a></li>
<li><a href='http://www.richardnichols.net/2010/02/visural-wicket-0-5-released-ready-for-action/' rel='bookmark' title='Permanent Link: visural-wicket 0.5 released &#8211; ready for action!'>visural-wicket 0.5 released &#8211; ready for action!</a></li>
<li><a href='http://www.richardnichols.net/2009/11/automatic-release-packaging-w-version-numbers-for-netbeans-java-projects/' rel='bookmark' title='Permanent Link: Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;'>Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/09/markdown-doclet-updated-to-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It&#8217;s About Time&#8230;</title>
		<link>http://www.richardnichols.net/2009/09/its-about-time/</link>
		<comments>http://www.richardnichols.net/2009/09/its-about-time/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 03:34:36 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[computer-science]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/2009/09/its-about-time/</guid>
		<description><![CDATA[Alan Turing get&#8217;s an apology&#8230;


No related posts.


No related posts.]]></description>
			<content:encoded><![CDATA[<p><a href="http://politics.slashdot.org/story/09/09/10/2221249/Alan-Turing-Gets-an-Apology-From-Prime-Minister-Brown">Alan Turing get&#8217;s an apology&#8230;</a></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/09/its-about-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Package (or Class) Filtering To Your Findbugs Ant Task</title>
		<link>http://www.richardnichols.net/2009/08/add-package-or-class-filtering-to-your-findbugs-ant-task/</link>
		<comments>http://www.richardnichols.net/2009/08/add-package-or-class-filtering-to-your-findbugs-ant-task/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 01:53:25 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[findbugs]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=192</guid>
		<description><![CDATA[Following on from my last post about using hbm2java to generate a @Entity bean DAO layer for our application, Findbugs, the great automatic bug finding tool, will find a lot of issues with Hibernate&#8217;s auto-generated code (primarily around exposing internal Date objects to callers). So long as this is something we are aware of and [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/' rel='bookmark' title='Permanent Link: Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task'>Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task</a></li>
<li><a href='http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/' rel='bookmark' title='Permanent Link: Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist'>Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist</a></li>
<li><a href='http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/' rel='bookmark' title='Permanent Link: Simple Guide To Sub-reports in JasperReports / iReport'>Simple Guide To Sub-reports in JasperReports / iReport</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Following on from my last post about using hbm2java to generate a @Entity bean DAO layer for our application, Findbugs, the great automatic bug finding tool, will find a lot of issues with Hibernate&#8217;s auto-generated code (primarily around exposing internal Date objects to callers). So long as this is something we are aware of and don&#8217;t have a problem with, we don&#8217;t want find bugs to tell us about this stuff. It&#8217;s possible to filter out an entire package or class tree with the use of Findbugs&#8217; filters.</p>
<p>For example, say we wanted to filter out the classes in the package <em>com.mycom.dbautodao</em>, we could create a<em> findbugs_filter.xml</em> which contains:</p>
<pre name="code" class="xml:nogutter">
&lt;FindBugsFilter&gt;
  &lt;Match&gt;
    &lt;Package name="~com\.mycom\.dbautodao\..*"/&gt;
  &lt;/Match&gt;
&lt;/FindBugsFilter&gt;
</pre>
<p>This uses a regular expression to filter out checks against all contents and sub-packages of the <em>com.mycom.dbautodao</em> package.</p>
<p>Similarly it&#8217;s possible to do the same with a &lt;class name=&#8221;myregex&#8221;/&gt; element rather than a &lt;package/&gt; element for finer control.</p>
<p>To enable the filtering we just need modify the <findbugs> tag in our Ant build file to include the filter, e.g.</p>
<pre name="code" class="xml:nogutter">
&lt;findbugs home="${findbugs.home}" output="xml" outputFile="${basedir}/dist/findbugs/findbugs.xml" excludefilter="findbugs_filter.xml"&gt;
</pre>
<p>While on the topic of regular expressions, I often find myself using <a href="http://www.fileformat.info/tool/regex.htm">this</a> online regex checker tool which uses Java&#8217;s regex syntax &#8211; <a href="http://www.fileformat.info/tool/regex.htm">http://www.fileformat.info/tool/regex.htm</a>. It&#8217;s a really quick and handy way of writing and testing a regular expression, since you can enter test string which provide both positive and negative test cases to develop against.</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/' rel='bookmark' title='Permanent Link: Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task'>Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task</a></li>
<li><a href='http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/' rel='bookmark' title='Permanent Link: Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist'>Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist</a></li>
<li><a href='http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/' rel='bookmark' title='Permanent Link: Simple Guide To Sub-reports in JasperReports / iReport'>Simple Guide To Sub-reports in JasperReports / iReport</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/08/add-package-or-class-filtering-to-your-findbugs-ant-task/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist</title>
		<link>http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/</link>
		<comments>http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 07:04:46 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[guice]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[warp-persist]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=186</guid>
		<description><![CDATA[This post sort of follows on from my last one &#8211; for the project I&#8217;m currently working on at work, we have a very large legacy database (1500+ tables) on top of which we are implementing a new business layer (Java/Guice).
Due to the legacy data structures (which are mostly in need of major refactoring, that [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/add-package-or-class-filtering-to-your-findbugs-ant-task/' rel='bookmark' title='Permanent Link: Add Package (or Class) Filtering To Your Findbugs Ant Task'>Add Package (or Class) Filtering To Your Findbugs Ant Task</a></li>
<li><a href='http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/' rel='bookmark' title='Permanent Link: Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task'>Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task</a></li>
<li><a href='http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/' rel='bookmark' title='Permanent Link: Automatic Javascript and CSS Compression For Java Webapps'>Automatic Javascript and CSS Compression For Java Webapps</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This post sort of follows on from my last one &#8211; for the project I&#8217;m currently working on at work, we have a very large legacy database (1500+ tables) on top of which we are implementing a new business layer (Java/<a href="http://code.google.com/p/google-guice/" target="_blank">Guice</a>).</p>
<p>Due to the legacy data structures (which are mostly in need of major refactoring, that can only occur in a long-term iterative fashion), we are completely segmenting the DAO layer from the business domain layer. The DAO layer and associated <em>@Entity</em> beans are generated automatically (and frequently) using the <em>hbm2java</em> tool which is part of <a href="https://www.hibernate.org/" target="_blank">Hibernate</a>. To make things even more complex, our business layer also supports multiple logical databases&#8230;. We are using <a href="http://code.google.com/p/google-guice/" target="_blank">Guice</a>, and the excellent <a href="http://www.wideplay.com/guicewebextensions2" target="_blank">warp-persist</a> library to manage the JPA transactions and bootstrapping across these multiple databases (multi-unit support is relatively new in warp-persist).</p>
<p>The problem then comes though &#8211; unless we manually add all of our 1000&#8217;s of @Entity beans to the JPA configuration for each persistence unit (which is a potential source of bugs, and a pain in the ass), how do we figure out which beans belong to which database unit? Well annotations is the way that warp-persist implements this, unfortunately, hbm2java doesn&#8217;t know that&#8230; (i.e. it won&#8217;t add theÂ annotationsÂ against the relevant classes).</p>
<p>This is actually easily solved using the same trick with Ant and the regex replacement from my last post&#8230;</p>
<pre name="code" class="xml:nogutter">
&nbsp;&nbsp;&nbsp;&lt;target&nbsp;name="gen_hibernate"&nbsp;description="generate&nbsp;hibernate&nbsp;classes"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;hibernatetool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;jdbcconfiguration&nbsp;revengfile="src/hibernate.reveng.xml"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;configurationfile="src/hibernate.cfg.xml"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;packagename="com.mycom.db.model"
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;detectmanytomany="true"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;hbm2java&nbsp;destdir="src"&nbsp;ejb3="true"&nbsp;jdk5="true"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/hibernatetool&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;loadfile&nbsp;property="javaheader"&nbsp;srcFile="lib/standardheader.txt"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;replaceregexp&nbsp;match="^package&nbsp;"&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replace="${javaheader}//&nbsp;DO&nbsp;NOT&nbsp;EDIT&nbsp;THIS&nbsp;FILE&nbsp;-&nbsp;THIS&nbsp;CODE&nbsp;IS&nbsp;AUTO-GENERATED${line.separator}package&nbsp;"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;fileset&nbsp;dir="src/com/mycom/db/model"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include&nbsp;name="**/*.java"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/fileset&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/replaceregexp&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;replaceregexp&nbsp;match="/\*\*.*generated&nbsp;by&nbsp;hbm2java.*\*/"&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flags="sm"&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replace="/**${line.separator}&nbsp;*&nbsp;@version&nbsp;$Id$&nbsp;${line.separator}&nbsp;*/${line.separator}"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;fileset&nbsp;dir="src/com/mycom/db/model"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include&nbsp;name="**/*.java"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/fileset&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/replaceregexp&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;replaceregexp&nbsp;match="@Entity"&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replace="@Entity&nbsp;@MyDbUnit"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;fileset&nbsp;dir="src/com/mycom/db/model"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include&nbsp;name="**/*.java"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/fileset&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/replaceregexp&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;replaceregexp&nbsp;match="import&nbsp;javax.persistence.Entity;"&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replace="import&nbsp;javax.persistence.Entity;&nbsp;import&nbsp;com.mycom.db.MyDbUnit;"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;fileset&nbsp;dir="src/com/mycom/db/model"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include&nbsp;name="**/*.java"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/fileset&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/replaceregexp&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/target&gt;
</pre>
<p>You&#8217;ll notice I threw in a couple of bonuses there too&#8230; the following changes are automatically made to all of the generated code -</p>
<ol>
<li>Our &#8220;standard header&#8221; (copyright / licence info) is added to the top of the file above the <em>package &#8230;.</em> descriptor.</li>
<li>The<em> @version $Id$</em> Javadoc tag is added to the class level Javadoc (this is assuming you&#8217;re using SVN or CVS &#8211; replace as necessary).</li>
<li>The database unit annotation (<em>@MyDbUnit</em> in this case) is added next the @Entity annotation.</li>
<li>Finally we add the import for the <em>@MyDbUnit</em> annotation (this would only be required if it&#8217;s in a separate package &#8211; which it in our case it is).</li>
</ol>
<p>We then copy / replicate this job for each database in the system (with appropriately separate hibernate.cfg.xml and hibernate.reveng.xml configurations).</p>
<p>Well I think this takes the cake for the most esoteric and narrow detail blog post yet&#8230; but my whole goal in setting up and posting to this blog is for my own future reference; if other people find it useful then that&#8217;s great, but really when I implement something that was kinda interesting, tricky, or indeed esoteric, then this is my own reference for later. YMMV.</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/add-package-or-class-filtering-to-your-findbugs-ant-task/' rel='bookmark' title='Permanent Link: Add Package (or Class) Filtering To Your Findbugs Ant Task'>Add Package (or Class) Filtering To Your Findbugs Ant Task</a></li>
<li><a href='http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/' rel='bookmark' title='Permanent Link: Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task'>Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task</a></li>
<li><a href='http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/' rel='bookmark' title='Permanent Link: Automatic Javascript and CSS Compression For Java Webapps'>Automatic Javascript and CSS Compression For Java Webapps</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task</title>
		<link>http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/</link>
		<comments>http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 02:10:20 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=157</guid>
		<description><![CDATA[A while ago I was looking for a way to automatically be able to update the standard &#8220;flowerbox text&#8221; at the start of all the source files in our projects. Generally this is the space where you would include information about the source licensing and that sort of thing.
My &#8220;best case scenario&#8221; was there was [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/' rel='bookmark' title='Permanent Link: Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist'>Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist</a></li>
<li><a href='http://www.richardnichols.net/2009/08/add-package-or-class-filtering-to-your-findbugs-ant-task/' rel='bookmark' title='Permanent Link: Add Package (or Class) Filtering To Your Findbugs Ant Task'>Add Package (or Class) Filtering To Your Findbugs Ant Task</a></li>
<li><a href='http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/' rel='bookmark' title='Permanent Link: Automatic Javascript and CSS Compression For Java Webapps'>Automatic Javascript and CSS Compression For Java Webapps</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A while ago I was <a href="http://stackoverflow.com/questions/699778/a-good-solution-to-include-some-template-text-into-a-source-file-using-svn" target="_blank">looking for a way</a> to automatically be able to update the standard &#8220;flowerbox text&#8221; at the start of all the source files in our projects. Generally this is the space where you would include information about the source licensing and that sort of thing.</p>
<p>My &#8220;best case scenario&#8221; was there was a way to automate this with Subversion (or another source control system), similar to how the keywords substitution works for things like <strong>$Id$</strong>, etc.</p>
<p>The answer I accepted in the end was that you need to automate this substitution programmatically as part of the build process (or separate process).</p>
<p>As it turns out this is pretty straightforward to perform with Ant&#8217;s ReplaceRegExp and LoadFile tasks&#8230;</p>
<pre name="code" class="xml:nogutter">
&lt;target&nbsp;name="replace_headers"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;loadfile&nbsp;property="javaheader"&nbsp;srcFile="lib/standardheader.txt"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;replaceregexp&nbsp;match="(/\*.*\*/.*)??^package&nbsp;"&nbsp;flags="sm"
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;replace="${javaheader}${line.separator}package&nbsp;"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;fileset&nbsp;dir="src"&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;include&nbsp;name="**/*.java"/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/fileset&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/replaceregexp&gt;
&lt;/target&gt;
</pre>
<p>So first of all we have placed our &#8220;standard text&#8221; in <em>lib/standardheader.txt</em>, and we then use a regular expression to find the first instance of a comment block (if one exists &#8211; optional) followed by the <em>package </em>header (I&#8217;m assuming <em>.java </em>source here, so you would modify the regex as required for other languages).</p>
<p>We use the LoadFile task to reader the text into a property used for replacement.</p>
<p>This is a very neat solution which can live in your build file ready to be used if your standard header text happens to change. You could apply the same type of trick to standardise class javadocs to include certain keywords such as $Id$ if were so inclined as well.</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/' rel='bookmark' title='Permanent Link: Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist'>Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist</a></li>
<li><a href='http://www.richardnichols.net/2009/08/add-package-or-class-filtering-to-your-findbugs-ant-task/' rel='bookmark' title='Permanent Link: Add Package (or Class) Filtering To Your Findbugs Ant Task'>Add Package (or Class) Filtering To Your Findbugs Ant Task</a></li>
<li><a href='http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/' rel='bookmark' title='Permanent Link: Automatic Javascript and CSS Compression For Java Webapps'>Automatic Javascript and CSS Compression For Java Webapps</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NetBeans 6.7 Broke My Parameterized Tests</title>
		<link>http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/</link>
		<comments>http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 04:35:49 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=152</guid>
		<description><![CDATA[If you had some JUnit parameterized tests with code such as:

import java.util.Collection;
import junit.framework.TestCase;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class MyParamTest extends TestCase {

    public MyParamTest(String s1, String s2) {
        // do something with s1 and s2
    }

    public static Collection getParams() {
 [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
<li><a href='http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/' rel='bookmark' title='Permanent Link: 5 Reasons Why NetBeans Rocks'>5 Reasons Why NetBeans Rocks</a></li>
<li><a href='http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/' rel='bookmark' title='Permanent Link: Simple Guide To Sub-reports in JasperReports / iReport'>Simple Guide To Sub-reports in JasperReports / iReport</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you had some JUnit parameterized tests with code such as:</p>
<pre name="code" class="java">
import java.util.Collection;
import junit.framework.TestCase;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class MyParamTest extends TestCase {

    public MyParamTest(String s1, String s2) {
        // do something with s1 and s2
    }

    public static Collection getParams() {
        // return test parameters
    }

    public void testSomeStuff() {
        // testing testing testing
    }
}
</pre>
<p>You may have found when you upgraded to Netbeans 6.7 (with the improved JUnit test runner) that your tests suddenly started failing.</p>
<p>This is because any class extending <code>TestCase</code> is run as a regular JUnit test and so will fail if it&#8217;s actually a parameterized test. Just change the code to use the <code>static import</code> instead:</p>
<pre name="code" class="java">
import java.util.Collection;
import static junit.framework.TestCase.*;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
public class MyParamTest {

    public MyParamTest(String s1, String s2) {
        // do something with s1 and s2
    }

    public static Collection getParams() {
        // return test parameters
    }

    public void testSomeStuff() {
        // testing testing testing
    }
}
</pre>
<p>Bob&#8217;s yer mother&#8217;s brother.</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
<li><a href='http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/' rel='bookmark' title='Permanent Link: 5 Reasons Why NetBeans Rocks'>5 Reasons Why NetBeans Rocks</a></li>
<li><a href='http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/' rel='bookmark' title='Permanent Link: Simple Guide To Sub-reports in JasperReports / iReport'>Simple Guide To Sub-reports in JasperReports / iReport</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing Abstract Classes With Mockito and JUnit</title>
		<link>http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/</link>
		<comments>http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 10:41:09 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[mockito]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=135</guid>
		<description><![CDATA[Often times in Java, you have an abstract parent class which has some concrete methods which call abstract methods which will be implemented by the child classes.
So what&#8217;s an easy way to test this sort of pattern?
A mock is not an appropriate solution, since we don&#8217;t want to mock our abstract class, we want to [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/' rel='bookmark' title='Permanent Link: NetBeans 6.7 Broke My Parameterized Tests'>NetBeans 6.7 Broke My Parameterized Tests</a></li>
<li><a href='http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/' rel='bookmark' title='Permanent Link: Simple Guide To Sub-reports in JasperReports / iReport'>Simple Guide To Sub-reports in JasperReports / iReport</a></li>
<li><a href='http://www.richardnichols.net/2009/07/unfortunately-interesting-java-generics/' rel='bookmark' title='Permanent Link: Unfortunately Interesting Java Generics'>Unfortunately Interesting Java Generics</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Often times in Java, you have an abstract parent class which has some concrete methods which call abstract methods which will be implemented by the child classes.</p>
<p>So what&#8217;s an easy way to test this sort of pattern?</p>
<p>A mock is not an appropriate solution, since we don&#8217;t want to mock our abstract class, we want to provide an implemention of the abstract methods, which we can mock to test the logic of the parent class.</p>
<p>There is a neat solution to this problem, using the great mocking framework for Java &#8211; <a href="http://mockito.org/">Mockito</a> -</p>
<pre name="code" class="java">
public abstract class MyAbstract {
  public String concrete() {
    return abstractMethod();
  }

  public abstract String abstractMethod();
}

public class MyAbstractImpl extends MyAbstract {
  public String abstractMethod() {
    // we have to provide an implementation that will run without error
    return null;
  }
}

public class MyAbstractTest extends TestCase {

  public void testConcrete() {
    MyAbstractImpl abstractImpl = spy(new MyAbstractImpl());
    doReturn("Blah").when(abstractImpl).abstractMethod();
    assertTrue("Blah".equals(abstractImpl.concrete()));
  }
}
</pre>
<p>So what&#8217;s going on here?</p>
<p>Well <a href="http://mockito.org/">Mockito</a> (1.8+) implements a &#8220;spy&#8221; feature which doesn&#8217;t mock the object, it creates a &#8220;spy&#8221; wrapper around the real method implementations. This allows us to override the return values / exception behaviour of some methods, but leave other methods to implement their usual behaviour.</p>
<p>In the code above, we override the abstractMethod() which is part of the implementation class, to test the concrete() method in our abstract class. Of course, usually the abstract class would be doing something more interesting than simply returning the implementor&#8217;s value, and so we would implement tests in the ususal fashion to test the different code paths in our concrete() method.</p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/' rel='bookmark' title='Permanent Link: NetBeans 6.7 Broke My Parameterized Tests'>NetBeans 6.7 Broke My Parameterized Tests</a></li>
<li><a href='http://www.richardnichols.net/2010/02/simple-guide-to-sub-reports-in-jasperreports-ireport/' rel='bookmark' title='Permanent Link: Simple Guide To Sub-reports in JasperReports / iReport'>Simple Guide To Sub-reports in JasperReports / iReport</a></li>
<li><a href='http://www.richardnichols.net/2009/07/unfortunately-interesting-java-generics/' rel='bookmark' title='Permanent Link: Unfortunately Interesting Java Generics'>Unfortunately Interesting Java Generics</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 Reasons Why NetBeans Rocks</title>
		<link>http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/</link>
		<comments>http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 14:51:29 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=126</guid>
		<description><![CDATA[I&#8217;m a long time NetBeans user, but I&#8217;m still surprised how many developers still haven&#8217;t given it a go. Certainly there was a time in the deep distant past when NetBeans couldn&#8217;t compete at the same level as Eclipse or IntelliJ, but NetBeans has been a first rate IDE for a long time now.
Read on [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/11/automatic-release-packaging-w-version-numbers-for-netbeans-java-projects/' rel='bookmark' title='Permanent Link: Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;'>Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;</a></li>
<li><a href='http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/' rel='bookmark' title='Permanent Link: Automatic Javascript and CSS Compression For Java Webapps'>Automatic Javascript and CSS Compression For Java Webapps</a></li>
<li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a long time NetBeans user, but I&#8217;m still surprised how many developers still haven&#8217;t given it a go. Certainly there was a time in the deep distant past when NetBeans couldn&#8217;t compete at the same level as Eclipse or IntelliJ, but NetBeans has been a first rate IDE for a long time now.</p>
<p>Read on for 5 features that might not be obvious to someone test-driving NetBeans for the first time&#8230;</p>
<h3>#1 Project Local Libraries</h3>
<p>Ticking the innocent looking &#8220;&#8221;Use Dedicated Folder for Storing Libraries&#8221; checkbox on creating a new Java project will simplify project portability down to a complete non-issue. All JAR dependancies are stored in the &#8220;lib&#8221; folder underneath your project and are automatically copied to the distribution folder at build time. You can guarantee to take your project to any machine and run the build with Ant (or NetBeans) and <strong>it just works.</strong></p>
<p><img class="aligncenter size-full wp-image-131" title="NetBeans Project Local Libraries" src="http://www.richardnichols.net/wp-content/uploads/2009/07/library.jpg" alt="NetBeans Project Local Libraries" width="500" height="345" /></p>
<h3 style="font-size: 1.17em;">#2 Customisable Ant Builds</h3>
<p>NetBeans uses Ant (by default) for managing all aspects of building, running, testing and documenting your Java projects. And while the builds are machine-generated they&#8217;re not impossible to read and work with.</p>
<p>However, you don&#8217;t even need to modify the NetBeans generated build logic &#8211; there are a whole bunch of &#8220;override points&#8221; in the build logic in which you can embed new logic, or override the default behaviour.</p>
<p>And since NetBeans uses Ant to build, deploy and run, you can guarantee that if it worked in your IDE, then it&#8217;ll work on the build server or anywhere else you want to build the project.</p>
<p><img class="aligncenter size-full wp-image-129" title="NetBeans Build Customisation" src="http://www.richardnichols.net/wp-content/uploads/2009/07/custombuild.jpg" alt="NetBeans Build Customisation" width="500" height="440" /></p>
<h3 style="font-size: 1.17em;">#3 Built-in Profiler</h3>
<p>The built in Java code profiler in NetBeans kicks ass. There are certainly equally useful, or better, tools available commericially, but for a pain-free out-of-the-box experience, the NetBeans profiler is great.</p>
<p><a href="http://www.netbeans.org/features/java/profiler.html" target="_blank">Features</a> include -</p>
<ul>
<li>Real-time display of run-time profiling</li>
<li>Filtering of profiled classes</li>
<li>Memory usage and garbage collection stats</li>
<li>Saveable profiling results for future comparisons</li>
<li>Low barrier to entry &#8211; very straightforward and simple to get started</li>
</ul>
<p><img class="aligncenter size-full wp-image-127" title="NetBeans Profiler" src="http://www.richardnichols.net/wp-content/uploads/2009/07/profiler.jpg" alt="NetBeans Profiler" width="500" height="336" /></p>
<h3 style="font-size: 1.17em;">#4 Refactoring Tools</h3>
<p>The refactoring tools are exactly what you would expect and allow you to move, rename and safely delete any code element as you need. The &#8220;Introduce Method&#8221; is particularly useful for refactoring code blocks that start to get a little too large. &#8220;Introduce Method&#8221; is probably not the logical name (it was renamed from &#8220;Extract Method&#8221;) but it does the job none-the-less.</p>
<p><img class="aligncenter size-full wp-image-130" title="NetBeans Refactoring Tools" src="http://www.richardnichols.net/wp-content/uploads/2009/07/intromethod.jpg" alt="NetBeans Refactoring Tools" width="600" height="432" /></p>
<h3 style="font-size: 1.17em;">#5 Call Hierarchy</h3>
<p>Tucked away in the context menu is the under-rated &#8220;Call Hierarchy&#8221; tool. Right click on any method and invoke the tool and immediately see all the callers, and their call stacks. Flip the switch and see the call stack that this method makes to other methods. This one tool can give you a very fast detailed understanding of what a method&#8217;s dependancies are. It&#8217;s a great way of coming up to speed on a code base without doing heaps of opening, closing of files and manual &#8220;eye-balling&#8221;.</p>
<p><img class="aligncenter size-full wp-image-128" title="NetBeans Call Heirarchy" src="http://www.richardnichols.net/wp-content/uploads/2009/07/callh.jpg" alt="NetBeans Call Heirarchy" width="400" height="347" /></p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/11/automatic-release-packaging-w-version-numbers-for-netbeans-java-projects/' rel='bookmark' title='Permanent Link: Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;'>Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;</a></li>
<li><a href='http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/' rel='bookmark' title='Permanent Link: Automatic Javascript and CSS Compression For Java Webapps'>Automatic Javascript and CSS Compression For Java Webapps</a></li>
<li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unfortunately Interesting Java Generics</title>
		<link>http://www.richardnichols.net/2009/07/unfortunately-interesting-java-generics/</link>
		<comments>http://www.richardnichols.net/2009/07/unfortunately-interesting-java-generics/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 02:06:10 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[syntax]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=115</guid>
		<description><![CDATA[The last couple of days I have been trying to come up with a sneaky way of creating an abstraction layer between a business object model and an external object model. In general these two models would be the same and in sync, but occasionally will need to be out of sync, in order to [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/' rel='bookmark' title='Permanent Link: NetBeans 6.7 Broke My Parameterized Tests'>NetBeans 6.7 Broke My Parameterized Tests</a></li>
<li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
<li><a href='http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/' rel='bookmark' title='Permanent Link: Automatic Javascript and CSS Compression For Java Webapps'>Automatic Javascript and CSS Compression For Java Webapps</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-thumbnail wp-image-122" title="Man on Mouse" src="http://www.richardnichols.net/wp-content/uploads/2009/07/man_on_mouse-150x150.jpg" alt="Man on Mouse" width="150" height="150" />The last couple of days I have been trying to come up with a sneaky way of creating an abstraction layer between a business object model and an external object model. In general these two models would be the same and in sync, but occasionally will need to be out of sync, in order to satisfy version control and backwards compatibility in the external interface.</p>
<p>I had planned to use separate interfaces bound to a single implementation class with Guice &#8211; thereby keeping a single implementation so long as the models are in sync, and having an interface contract that will be break should a developer try to modify the model without understanding the implications to the dependent layers.</p>
<p>This seemed like a great approach, but my less-than-deep understanding of Java Generics has thrown a spanner into the works.</p>
<p><a href="http://www.ibm.com/developerworks/java/library/j-jtp01255.html" target="_blank">This article at IBM Developerworks </a>is a good read -</p>
<blockquote><p>[Generics] bear a superficial resemblance to templates in C++, both in their syntax and in their expected use cases. But the similarity is only skin-deep &#8212; generics in the Java language are implemented almost entirely in the compiler, which performs type checking and type inference, and then generates ordinary, non-generic bytecodes.</p></blockquote>
<p>This key point here is that generics are implemented <em>almost entirely in the Java compiler</em>. This was something I was aware of, but hadn&#8217;t really given any thought as to what that means. At the simplest level, that makes a class such as this one, <strong>invalid</strong> -</p>
<pre  name="code" class="java">  public class DoesNotCompile {
      public void setList(List&lt;String&gt; stringList);
      public void setList(List&lt;Integer&gt; integerList);
  }</pre>
<p>Whereas the non-generic equivalent is perfectly valid -</p>
<pre name="code" class="java">  public class CompilesJustFine {
      public void set(String string);
      public void set(Integer integer);
  }</pre>
<p>This is because that while List&lt;String&gt; and List&lt;Integer&gt; are differentiated at compile time, they are both just List classes that are indistinguishable from one-another.</p>
<blockquote><p>Because of erasure, <code>List&lt;Integer&gt;</code> and <code>List&lt;String&gt;</code> are the same class, and the compiler only generates one class when compiling <code>List&lt;V&gt;</code> (unlike in C++). As a result, the compiler doesn&#8217;t know what type is represented by <code>V</code> when compiling the <code>List&lt;V&gt;</code> class, and so you can&#8217;t do certain things with a type parameter (the <code>V</code> in <code>List&lt;V&gt;</code>) within the class definition of <code>List&lt;V&gt;</code> that you could do if you knew what class was being represented.</p></blockquote>
<p>Also, parent-child class relationships don&#8217;t work as you might expect on first perception. For example you might think it is reasonable to use a List&lt;Integer&gt; where a List&lt;Number&gt; is required. Integer is a child class of Number, why isn&#8217;t that valid?</p>
<blockquote><p>It turns out there&#8217;s a good reason it doesn&#8217;t work that way: It would break the type safety generics were supposed to provide. Imagine you could assign a <code>List&lt;Integer&gt;</code> to a <code>List&lt;Number&gt;</code>. Then the following code would allow you to put something that wasn&#8217;t an <code>Integer</code> into a <code>List&lt;Integer&gt;</code>:</p>
<pre>List&lt;Integer&gt; li = new ArrayList&lt;Integer&gt;();
List&lt;Number&gt; ln = li; // illegal
ln.add(new Float(3.1415));</pre>
</blockquote>
<p>But. we can work around that by using <code>List&lt;? extends Number&gt;</code> instead, thereby making it clear we&#8217;re not fussed if it&#8217;s a Number, or any of it&#8217;s children.</p>
<blockquote><p>learning to use generics will almost certainly provide some opportunity for head-scratching (and sometimes cursing) along the way.</p></blockquote>
<p>Yep.<br />
And as for my actual problem with the interface binding? Well my <a href="http://stackoverflow.com/questions/1141068/is-there-a-way-with-java-generics-to-take-generic-parameter-that-requires-impleme">question at stackoverflow.com</a> tells the story <img src='http://www.richardnichols.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/netbeans-6-7-broke-my-parameterized-tests/' rel='bookmark' title='Permanent Link: NetBeans 6.7 Broke My Parameterized Tests'>NetBeans 6.7 Broke My Parameterized Tests</a></li>
<li><a href='http://www.richardnichols.net/2009/07/testing-abstract-classes-with-mockito-and-junit/' rel='bookmark' title='Permanent Link: Testing Abstract Classes With Mockito and JUnit'>Testing Abstract Classes With Mockito and JUnit</a></li>
<li><a href='http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/' rel='bookmark' title='Permanent Link: Automatic Javascript and CSS Compression For Java Webapps'>Automatic Javascript and CSS Compression For Java Webapps</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/07/unfortunately-interesting-java-generics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recruitment From The &#8220;Other Side&#8221; &#8211; Part 1</title>
		<link>http://www.richardnichols.net/2009/07/recruitment-from-the-other-side-part-1/</link>
		<comments>http://www.richardnichols.net/2009/07/recruitment-from-the-other-side-part-1/#comments</comments>
		<pubDate>Mon, 06 Jul 2009 07:37:15 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[cv]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[recruitment]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=15</guid>
		<description><![CDATA[Five tips for people applying for an IT or technical job.
Recently I was involved in recruitment for a number of development positions. Although I have reviewed CVs and done interviewing before, it had been specific roles with only a couple of candidates, whereas the recent positions had a large number of applicants for multiple positions.
This [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/07/recruitment-from-the-other-side-part-2/' rel='bookmark' title='Permanent Link: Recruitment from the Other Side &#8211; Part 2'>Recruitment from the Other Side &#8211; Part 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><strong>Five tips for people applying for an IT or technical job.</strong></p>
<p>Recently I was involved in recruitment for a number of development positions. Although I have reviewed CVs and done interviewing before, it had been specific roles with only a couple of candidates, whereas the recent positions had a large number of applicants for multiple positions.</p>
<p>This was a very interesting process to be involved in, and has given me a different perspective on the job application process which I believe will be helpful in the future when applying for IT jobs. Read on for the common problems and some tips I found when reviewing candidates applications&#8230;</p>
<p><em>NB. This is solely based on my personal experience and (of course) I am not a HR professional, but often for technical roles it will be a technical resource that evaluates the candidates, so with that in mind, read on&#8230;</em></p>
<p><strong>Key Point</strong></p>
<blockquote><p>Think about the person who is reviewing your application and communicate to them.</p></blockquote>
<p>They probably have a whole pile of CVs and application letters to read through, and they have a good idea of the sort of candidate they have for the job(s). They are trying to eliminate as many people as they can on that basis, as quickly as possible.</p>
<p>And, <em>more than anything else</em>, they want to know how well does your experience match up with the job needing to be filled?</p>
<p>With that in mind, tailor your application to <strong>make the reviewer&#8217;s job as easy as possible</strong>.</p>
<p><strong>Tip #1 &#8211; Keep it simple and concise.</strong></p>
<p><img class="size-thumbnail wp-image-70 alignright" title="1113494_84748570" src="http://www.richardnichols.net/wp-content/uploads/2009/07/1113494_84748570-150x150.jpg" alt="1113494_84748570" width="150" height="150" />You have no idea how many people have applications numbering almost 10 pages. With a CV of that size you are telling the reviewer one of two things:</p>
<ul>
<li>You don&#8217;t know what skills are important to the job, so you are putting down everything in the hope that something will be relevant.</li>
<li>You are too lazy to tailor your application to the position you are applying for.</li>
</ul>
<p>So you&#8217;re either inept or lazy, neither of which are desirableÂ in prospective employee. Keep your CV to 3 or 4 pages at the most, less if you can. Don&#8217;t add lists of skills you <em>say </em>you have, but can&#8217;t back up with some <em>tangible experience or qualification</em>.</p>
<p>Which leads me to the next tip&#8230;</p>
<p><strong>Tip #2 &#8211; Remember that the reader is a skeptical one.</strong></p>
<div><img class="size-thumbnail wp-image-69 alignleft" title="Dog with glasses" src="http://www.richardnichols.net/wp-content/uploads/2009/07/photo_137_20080825-150x150.jpg" alt="Dog with glasses" width="150" height="150" />The reader will be skeptical of your past work, performance and achievements. It is your task to prove to them that you are as good as you say.</div>
<div>A lot of applicants tend to write down the things that their <em>company or team</em> did, not the things that <em>they</em> did. That&#8217;s the worst mistake you can make.</div>
<blockquote><p><strong>Make it clear what <span style="text-decoration: underline;">you</span> did.</strong></p></blockquote>
<p>Some people seem to think that being in a team that was building a product &#8220;X&#8221; or using a technology &#8220;Y&#8221; means you can say you are an expert in creating and using &#8220;X&#8221; or &#8220;Y&#8221;. That might get you an interview if you&#8217;re lucky, but you better have the skills to back it up.</p>
<p>In most cases, it is very time consuming and difficult for someone reviewing an application to figure out what the applicant actually did in their past work.</p>
<p>So make sure you write your past experience in the context of what you did while you were there, and what <em>you </em>contributed specifically!</p>
<blockquote><p><strong>Make it clear the technologies <span style="text-decoration: underline;">you </span>used to do the things <span style="text-decoration: underline;">you </span>did.</strong></p></blockquote>
<p>Just because someone in your team used <em>[technology X]</em> doesn&#8217;t make you an expert in <em>[technology X]</em>. The person reviewing your application knows that, so tell them what tools you used to achieve the things you said you did.</p>
<p>Notice I wrote, &#8220;the things you said you did&#8221;. A large number of applicants write a big box at the start of their CV&#8217;s with 50 different technologies / languages / frameworks and a number of years experience. Someone reviewing your application is very unlikely to take something like that at face value, and similar to my first tip, shows that you are just trying to get a foot in the door on the basis of some buzzword. It might work, but it adds more noise than signal, and again, you better be able to back up all those technlogies with skills and experience.</p>
<p><strong>Tip #3 &#8211; Write your past work experience in layman&#8217;s terms.</strong></p>
<p><img class="size-thumbnail wp-image-68 alignright" title="Wine Glasses" src="http://www.richardnichols.net/wp-content/uploads/2009/07/photo_3780_20090122-150x150.jpg" alt="Wine Glasses" width="150" height="150" />Unless you are applying for a job at a workplace in the same industry or business domain as your last one, try to explain all your past projects in layman&#8217;s terms. Avoid domain-specific language or buzzwords, and concentrate on the value delivered to users and types of systems (technology) that you built and delivered.</p>
<p>My rule of thumb would be -</p>
<blockquote><p><em>Explain your past work experiences as you might explain them at a dinner party with friends.</em></p></blockquote>
<p>Industry-specific jargon and buzz-words will be lost on the reader if you are applying for a job in a different domain, and just add noise to your message. You want the reviewer of your application to understand what you did, not be baffled by it.</p>
<p><strong>Tip #4 &#8211; Ditch baggage.</strong></p>
<p><img class="size-thumbnail wp-image-66 alignleft" title="Baggage" src="http://www.richardnichols.net/wp-content/uploads/2009/07/photo_3277_20090106-150x150.jpg" alt="Baggage" width="150" height="150" /></p>
<p>This is an extension of Tip #1 &#8211; more is not always better.</p>
<p>If you have 10+ years industry experience, you don&#8217;t need to include a university transcript with all your results. For any professional position that requires tertiary qualifications, you certainly don&#8217;t need to mention your primary and secondary school activities!</p>
<p>Similarly, if you have past experience that you&#8217;re not proud of, for example poor university results or a job at a company that didn&#8217;t reflect well on you, leave it out! You need to sell yourself (without distorting the truth), so leave out old baggage. You can talk about some of those things at the interview if you are asked, and maybe comment on those less-than-stellar experiences in the context of learning experiences, but don&#8217;t present them on a CV where you can&#8217;t put them into context for the reader.<em> (Remember the reader is a skeptical one!)</em></p>
<p><strong>Tip #5 &#8211; It&#8217;s okay to have a personality!</strong></p>
<p><img class="size-thumbnail wp-image-71 alignright" title="Dude with hat and sunnies" src="http://www.richardnichols.net/wp-content/uploads/2009/07/1196982_23611958-150x150.jpg" alt="Dude with hat and sunnies" width="150" height="150" />TheÂ vast majority of applications read very professionally, and very <em>dry</em>. Most people have interesting personalities, likes, dislikes, quirks and interests. It&#8217;s okay to present yourself with a little personality. In fact it is the single easiest way to set yourself apart from other applicants.</p>
<p>Talking about the hobbies and interests you have outside of work (and consider writing a sentence about them, not just personality-less dot-points) is a good way to let the reader know what sort of person you are.</p>
<p>If you are passionate about, something, <em>anything </em>- talk about it. Appear as a person, not a &#8220;professional&#8221;. We work with <em>people,</em> not professionals on a daily basis, despite what some companies or cultures want you to believe.</p>
<p>Your past experience and technical knowledge are only 50% of what contribute to getting you a job, the other 50% is personality and attitude. If you don&#8217;t have a personality on paper you are hiding half the information the employer needs to make a decision on whether to hire you.</p>
<p><em>A note about including photos of yourself&#8230;</em></p>
<p>Including a photo of yourself is one way to add personality to your application; but <em>make sure it&#8217;s a good photo</em>! If you include a weird, poorly lit or too casual photo then you&#8217;re better off not to include one at all. I would recommend that you err on the side of<em> not including</em> a photo, unless you feel very sure that it will add value to your application.</p>
<div><strong>Wrapping Up.</strong></div>
<div><strong><br />
</strong></div>
<div>So, that covers the application process. Stay tuned forÂ <strong>Part 2</strong>, which will cover the next step of the process &#8211; the dreaded <em>job interview</em>.</div>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/07/recruitment-from-the-other-side-part-2/' rel='bookmark' title='Permanent Link: Recruitment from the Other Side &#8211; Part 2'>Recruitment from the Other Side &#8211; Part 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/07/recruitment-from-the-other-side-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Automatic Javascript and CSS Compression For Java Webapps</title>
		<link>http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/</link>
		<comments>http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 07:07:11 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=45</guid>
		<description><![CDATA[One of the &#8220;no brainer&#8221; ways to make your web sites / web apps load faster for users is to utilise Javascript and CSS compression.
This means at least, stripping out all the white-space, comments and other non-essential character data from your files, but can also mean code compression / obfuscation as well.
One of the best [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/11/automatic-release-packaging-w-version-numbers-for-netbeans-java-projects/' rel='bookmark' title='Permanent Link: Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;'>Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;</a></li>
<li><a href='http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/' rel='bookmark' title='Permanent Link: Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task'>Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task</a></li>
<li><a href='http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/' rel='bookmark' title='Permanent Link: 5 Reasons Why NetBeans Rocks'>5 Reasons Why NetBeans Rocks</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>One of the &#8220;no brainer&#8221; ways to make your web sites / web apps load faster for users is to utilise Javascript and CSS compression.</p>
<p>This means at least, stripping out all the white-space, comments and other non-essential character data from your files, but can also mean code compression / obfuscation as well.</p>
<p>One of the best tools for this task is <a href="http://developer.yahoo.com/yui/compressor/" target="_blank">Yahoo&#8217;s YUI Compressor</a>, which does a fantastic job of compressing down both .js and .css files.</p>
<p>Better yet, it is very easy to automate this compression process as part of your <a href="http://ant.apache.org/" target="_blank">Ant</a> build process for a standard Java web application.</p>
<p>Read on for the details&#8230;</p>
<p>We&#8217;ll need a couple of add-on JAR libraries; firstly (and most obviously), YUI Compressor, which is available from Yahoo as a single JAR which can be placed into our &#8220;lib/&#8221; folder of our web project (or similar location &#8211; I will assume lib/ for now).</p>
<p>Secondly we will need an add-on task for Ant in the <a href="http://ant-contrib.sourceforge.net/" target="_blank">ant-contrib</a> project which allows us to iterate the file system, performing tasks (the &lt;foreach&gt; task). Note, that the sourceforge site for the ant-contrib project is a little confusing, you may have to view &#8220;all downloads&#8221; to find the actual ant-contrib JAR download.</p>
<p>Again place this download in the lib/ folder of the web project.</p>
<p>Now we can change our build file to compress&#8230;</p>
<pre name="code" class="xml">    &lt;taskdef resource="net/sf/antcontrib/antcontrib.properties"&gt;
        &lt;classpath&gt;
            &lt;pathelement location="lib/ant-contrib-0.6.jar"/&gt;
        &lt;/classpath&gt;
    &lt;/taskdef&gt;

    &lt;target name="yuicompress"
            description="Compresses a CSS or JS file using YUI compressor"&gt;
        &lt;java jar="lib/yuicompressor-2.4.2.jar" fork="true"&gt;
            &lt;arg value="-o"/&gt;
            &lt;arg value="${yuicFile}.comp"/&gt;
            &lt;arg value="${yuicFile}"/&gt;
        &lt;/java&gt;
        &lt;move file="${yuicFile}.comp" tofile="${yuicFile}"/&gt;
    &lt;/target&gt;

    &lt;target name="-post-compile"&gt;
        &lt;foreach target="yuicompress" param="yuicFile"&gt;
            &lt;path&gt;
                &lt;fileset dir="build"&gt;
                    &lt;include name="**/*.js"/&gt;
                    &lt;include name="**/*.css"/&gt;
                &lt;/fileset&gt;
            &lt;/path&gt;
        &lt;/foreach&gt;
    &lt;/target&gt;</pre>
<p>The key task to invoke is the &#8220;-post-compile&#8221; task. This is based off a standard Netbeans web project build.xml, but you can use this in a free-form build.xml just as easily by calling the -post-compile target as a dependancy of your packaging / WAR target.</p>
<p>Essentially after the build step and prior to WAR packaging we compress in-place the .CSS and .JS files in the build folder. The nice thing about this approach is that we can work on human-readable CSS and Javascript in our IDE but deploy compressed content automatically. There is no need to maintain a &#8220;myCode.js&#8221; and &#8220;myCode.min.js&#8221; and you can even work with the &#8220;non-minified&#8221; versions of your favourite API should you wish to as well.</p>
<p>Yahoo! <img src='http://www.richardnichols.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/11/automatic-release-packaging-w-version-numbers-for-netbeans-java-projects/' rel='bookmark' title='Permanent Link: Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;'>Automatic release packaging w/ version numbers for Netbeans Java Projects&#8230;</a></li>
<li><a href='http://www.richardnichols.net/2009/08/automatically-updating-your-source-file-headers-with-ants-replaceregexp/' rel='bookmark' title='Permanent Link: Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task'>Automatically Updating Your Source File Headers With Ant&#8217;s ReplaceRegExp Task</a></li>
<li><a href='http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/' rel='bookmark' title='Permanent Link: 5 Reasons Why NetBeans Rocks'>5 Reasons Why NetBeans Rocks</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/07/automatic-javascript-and-css-compression-for-java-webapps/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Markdown Doclet for Javadoc</title>
		<link>http://www.richardnichols.net/2009/06/markdown-doclet-for-javadoc/</link>
		<comments>http://www.richardnichols.net/2009/06/markdown-doclet-for-javadoc/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 12:40:14 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[doclet]]></category>
		<category><![CDATA[documentation]]></category>
		<category><![CDATA[javadoc]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[open-source]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=32</guid>
		<description><![CDATA[
I spent some spare time this week creating a mash up of sorts&#8230; a &#8220;markdown&#8221; doclet for Javadoc.
Markdown-Doclet Project on Google Code
Markdown is a light-weight markup language which reads much like plain-ASCII-formatted-text, as opposed to HTML which reads like&#8230; well HTML.
In fact HTML is pretty damny unreadable, which is why is frustrates me to see [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/09/markdown-doclet-updated-to-v2/' rel='bookmark' title='Permanent Link: markdown-doclet Updated to v2'>markdown-doclet Updated to v2</a></li>
<li><a href='http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/' rel='bookmark' title='Permanent Link: 5 Reasons Why NetBeans Rocks'>5 Reasons Why NetBeans Rocks</a></li>
<li><a href='http://www.richardnichols.net/2009/06/the-5-minute-guice-primer/' rel='bookmark' title='Permanent Link: The 5 Minute Guice Primer'>The 5 Minute Guice Primer</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.richardnichols.net/custom/markdown/example.jpg" target="_blank"><img class="alignright" title="Markdown Doclet Example" src="http://www.richardnichols.net/custom/markdown/example.jpg" alt="" width="300" height="147" /></a></p>
<p>I spent some spare time this week creating a mash up of sorts&#8230; a &#8220;markdown&#8221; doclet for Javadoc.</p>
<p><a href="http://code.google.com/p/markdown-doclet/" target="_blank"><em>Markdown-Doclet Project on Google Code</em></a></p>
<p><a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown </a>is a light-weight markup language which reads much like plain-ASCII-formatted-text, as opposed to HTML which reads like&#8230; well HTML.</p>
<p>In fact HTML is pretty damny unreadable, which is why is frustrates me to see developers putting a whole &lt;ul&gt;&lt;li&gt;bunch&lt;/li&gt;&lt;li&gt; of&lt;/li&gt;&lt;li&gt; html&lt;/li&gt;&lt;/li&gt; &lt;li&gt;tags&lt;/li&gt;&lt;/ul&gt; in their code&#8217;s Javadoc comment boxes only to rended it almost impossible to read in the place where you&#8217;re most likely to read it (in the code).</p>
<p>The idea of the Markdown doclet is that you can write simple (markdown) text into your Javadoc comments and they will be translated nicely into HTML in your final Javadoc output.</p>
<p>The hardest part of this doclet was figuring out <a href="http://forums.sun.com/thread.jspa?threadID=773492" target="_blank">how the hell to patch the standard Sun doclet</a> post Java 1.5. In fact the answer to this is that you need to duplicate the whole damn thing, since they effectively stopped anyone using any part of the current class tree by putting a hard lock into the code.</p>
<p>I was quite suprised at how badly supported the whole Javadoc tool is by Sun. I would see Javadoc as being one of the best out-of-the-box features of the Java platform and probably one of the biggest reasons for it&#8217;s wide adoption in the early years.</p>
<p>Anyhow, I have basically glued together the (GPL&#8217;ed) Sun doclet (with some changes), <a href="http://code.google.com/p/markdownj/" target="_blank">MarkdownJ </a>(a Java implementation of Markdown) and UMLGraph.</p>
<p><a href="http://www.umlgraph.org/" target="_blank">UMLGraph</a>? &#8211; Well I love the UMLGraph doclet which embeds UML class diagrams into your Javadocs. The UMLGraph doclet works by calling the Sun standard doclet and then doing some mods on the files that are generated, so the markdown doclet can work interchangeably with UMLGraph, albeit I had to patch UMLGraph to make that happen, since the Sun standard doclet doesn&#8217;t implement any standard interface which would allow a drop in replacement!</p>
<p>I hope other developers can make use of this doclet, and we can keep HTML in our browsers where it belongs! <img src='http://www.richardnichols.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/09/markdown-doclet-updated-to-v2/' rel='bookmark' title='Permanent Link: markdown-doclet Updated to v2'>markdown-doclet Updated to v2</a></li>
<li><a href='http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/' rel='bookmark' title='Permanent Link: 5 Reasons Why NetBeans Rocks'>5 Reasons Why NetBeans Rocks</a></li>
<li><a href='http://www.richardnichols.net/2009/06/the-5-minute-guice-primer/' rel='bookmark' title='Permanent Link: The 5 Minute Guice Primer'>The 5 Minute Guice Primer</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/06/markdown-doclet-for-javadoc/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The 5 Minute Guice Primer</title>
		<link>http://www.richardnichols.net/2009/06/the-5-minute-guice-primer/</link>
		<comments>http://www.richardnichols.net/2009/06/the-5-minute-guice-primer/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 12:48:34 +0000</pubDate>
		<dc:creator>rn</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[guice]]></category>
		<category><![CDATA[ioc]]></category>
		<category><![CDATA[open-source]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.richardnichols.net/?p=20</guid>
		<description><![CDATA[I&#8217;ve just finished getting up to speed with Google&#8217;sÂ Guice 2.0 and have integrated it into two of my projects. It&#8217;s been a very comfortable experience and I could see myself Guicifying most of my Java projects from now on.
To summarise my experiences &#8211; Guice is a Dependancy Injection and Aspect Oriented Programming framework for Java. [...]


Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/' rel='bookmark' title='Permanent Link: Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist'>Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist</a></li>
<li><a href='http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/' rel='bookmark' title='Permanent Link: 5 Reasons Why NetBeans Rocks'>5 Reasons Why NetBeans Rocks</a></li>
<li><a href='http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/' rel='bookmark' title='Permanent Link: Wicket On Google App Engine (GAE) &#8211; Deployment Configuration'>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just finished getting up to speed with Google&#8217;sÂ <a href="http://code.google.com/p/google-guice/" target="_blank">Guice 2.0</a> and have integrated it into two of my projects. It&#8217;s been a very comfortable experience and I could see myself Guicifying most of my Java projects from now on.</p>
<p>To summarise my experiences &#8211; Guice is a <a href="http://en.wikipedia.org/wiki/Dependency_injection" target="_blank">Dependancy Injection</a> and <a href="http://en.wikipedia.org/wiki/Aspect-oriented_programming" target="_blank">Aspect Oriented Programming</a> framework for Java. This is the turf that&#8217;s normally owned by <a href="http://www.springsource.org/" target="_blank">Spring </a>of course.</p>
<p>So how is Guice different to Spring?</p>
<ul>
<li>No XML!</li>
<li>Narrower scope: Guice only does DI and AOP, unlike Spring which covers a wide gamut of requirements.</li>
<li>Heavy and mandatory use of annotations.</li>
<li>&#8230;and in my opinion, a more refined and elegant design.</li>
</ul>
<p>I think one of the main reasons I like Guice so much is the absence of XML. I really hate XML and Guice&#8217;s &#8220;Module&#8221; concept is a great replacement for text configuration. I would be interested to know how often in practice that Spring&#8217;s XML configuration is changed in situations where a rebuild of the application is impossible. The argument for that sort of configuration has always seemed like a straw man to me. As a bonus of the Guice Module approach, you get type checking and compilation of your configuration. [It would be interesting to see if someone does implement an XML configurator for Guice though - I'd say it's only a matter of time].</p>
<p>How to get up to speed real fast?</p>
<ol>
<li>If you&#8217;re not familiar with DI and/or AOP then do some reading. A framework can only solve a problem that you know you have.</li>
<li>Watch the recent <a href="http://www.youtube.com/watch?v=hBVJbzAagfs" target="_blank">Google IO tech session</a> for the 60 minute fast-track introduction.</li>
<li>The <a href="http://code.google.com/p/google-guice/wiki/Motivation?tm=6" target="_blank">Guice wiki</a> is helpful, but I found the <a href="http://code.google.com/p/google-guice/wiki/ExternalDocumentation" target="_blank">external links</a> and <a href="http://groups.google.com/group/google-guice" target="_blank">discussion group</a> to be more helpful.</li>
<li>Write something! It&#8217;s a dead easy framework to get your head around, and the fastest way to solidify your knowledge is to <strong>do</strong>.</li>
</ol>


<p>Related posts:<ol><li><a href='http://www.richardnichols.net/2009/08/using-bottom-up-iterative-object-database-layer-with-hbm2java-and-warp-persist/' rel='bookmark' title='Permanent Link: Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist'>Using Bottom-Up Iterative Object/Database Layer With hbm2java and warp-persist</a></li>
<li><a href='http://www.richardnichols.net/2009/07/5-reasons-why-netbeans-rocks/' rel='bookmark' title='Permanent Link: 5 Reasons Why NetBeans Rocks'>5 Reasons Why NetBeans Rocks</a></li>
<li><a href='http://www.richardnichols.net/2010/03/wicket-on-google-app-engine-gae-deployment-configuration/' rel='bookmark' title='Permanent Link: Wicket On Google App Engine (GAE) &#8211; Deployment Configuration'>Wicket On Google App Engine (GAE) &#8211; Deployment Configuration</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.richardnichols.net/2009/06/the-5-minute-guice-primer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
