<?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>ryan norris &#187; Building Better Software</title>
	<atom:link href="http://www.ryannorris.com/category/building-better-software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryannorris.com</link>
	<description>managing software teams and delivering great results</description>
	<lastBuildDate>Fri, 25 Jun 2010 13:44:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Technology Grudges and the Cult of Building Your Own Software</title>
		<link>http://www.ryannorris.com/2010/01/05/technology-grudges-and-the-cult-of-building-your-own-software/</link>
		<comments>http://www.ryannorris.com/2010/01/05/technology-grudges-and-the-cult-of-building-your-own-software/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 04:36:28 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Building Better Software]]></category>
		<category><![CDATA[Building It Better]]></category>
		<category><![CDATA[Consulting]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=141</guid>
		<description><![CDATA[It has come to pass that in my travels, I have been introduced to or worked with people with certain grudges in the technology realm.  Myself included, it is pretty simple to run into a problem in an experience that sours you on a particular tool.  Hell, my father-in-law held a pretty decent grudge against [...]]]></description>
			<content:encoded><![CDATA[<p>It has come to pass that in my travels, I have been introduced to or worked with people with certain grudges in the technology realm.  Myself included, it is pretty simple to run into a problem in an experience that sours you on a particular tool.  Hell, my father-in-law held a pretty decent grudge against Honda automobiles until the early 90&#8242;s.  The reason&#8217;s for his slight towards the maker of the Accord was a bit different from the people I come across who hold technologies in low regard &#8211; the people who roll their eyes at Java, the religious fanatics who loathe all things Microsoft, the experienced programmers who will never touch Perl.  We tend to be shaped more by our poor experiences than our positive ones.  The technologist &#8220;grudge&#8221; is the burden some people carry with them for a lifetime after a poor experience, and while it&#8217;s understandable and to an extend prudent to adopt a <em>once bitten, twice shy </em>perspective, it is more valuable to take that experience and either improve the subject technology (particularly in the instances of community software) or evaluate alternatives that exist.</p>
<p>But some of the weary techies I&#8217;ve worked with (particularly middle-management types, for some reason) go off the deep end.  I like to say that when you encounter a technical challenge &#8211; there&#8217;s likely someone else who has also needed to solve a similar problem.  In the instances where that isn&#8217;t the case &#8211; you&#8217;re in a pretty good position to gain something from solving it yourself.  But truth be told, there are very few large problems out there that people aren&#8217;t solving.  And yet IT organizations continue to re-invent the wheel &#8211; even when economics and time tell them that they should look for an off-the-shelf solution.  This only leaves one real driver for making the build decision when the buy decision is so apparent: politics.  And often it&#8217;s the politics of the grudge.</p>
<p>I firmly believe that every shop I&#8217;ve walked into that has rolled their own MVC framework, or RIA framework, or rules framework contains an individual who truly believes that the cost of supporting, maintaining, and continuously developing that software is still less than the cost of taking a turnkey solution &#8211; either one that is commercial or open source.  I recently had a manager tell me that there was an increasing drive through the IT management structure that the enterprise should own the source and rights to all of the systems that it supports.  This was a crazy notion &#8211; are their boundaries to this doctrine?  Will we be writing our own application servers?  RDBMS?  Messaging systems?  Where does this cult draw the line?  And with a little more digging, and without much surprise &#8211; I found that this manager had spearheaded a campaign to adopt a particular Javascript framework for client development that ultimately failed and cost the company several millions of dollars.  His dogma seemed crazy, and it was. But it was completely motivated out of fear that technology selection, no matter where the accountability lay &#8211; was an avoidable cost of enterprise IT, even if it meant adopting the more extensive cost of building all solutions from the ground up whenever the need arose.</p>
<p>I guess the moral of the story is really that as an IT manager, it&#8217;s important to recognize the power of the crowd (the community if you will) and the value it can add at virtually no cost to your organization.  That it&#8217;s important to understand why a 3rd party tool has been selected.  That it&#8217;s general limitations are known early on.  That your organization is prepared to adopt the tool as if it were it&#8217;s very own.  This means hiring experts who have used those technologies.  And above and beyond anything else, that when you fail &#8211; the goal must be to marginalize the cost of that failure.  You can hedge your bets, you can reduce risk.  But when the dust settles and a selected technology has failed the organization &#8211; be sure to take a good hard look in the mirror and be open about where the selection process has failed.</p>
<p>Sometimes it is the captain, and not the ship.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2010/01/05/technology-grudges-and-the-cult-of-building-your-own-software/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RPC Objects in GWT Now MUST be Serializable</title>
		<link>http://www.ryannorris.com/2009/12/13/rpc-objects-in-gwt-now-must-be-serializable/</link>
		<comments>http://www.ryannorris.com/2009/12/13/rpc-objects-in-gwt-now-must-be-serializable/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 04:42:15 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[GWT]]></category>
		<category><![CDATA[Java Development]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=134</guid>
		<description><![CDATA[Okay, so maybe it&#8217;s always been this way and I&#8217;ve just not been paying attention &#8211; but it appears that GWT 2.0 now requires one to make RPC objects that will go across the wire explicitly implement java.io.Serializable. A bland RPC implementation that was based on past work I&#8217;ve done was barfing all over me [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so maybe it&#8217;s always been this way and I&#8217;ve just not been paying attention &#8211; but it appears that GWT 2.0 now requires one to make RPC objects that will go across the wire explicitly implement <code>java.io.Serializable</code>.</p>
<p>A bland RPC implementation that was based on past work I&#8217;ve done was barfing all over me at GWT compile-time today:</p>
<pre><span>Rebinding com.<span>ryannorris</span>.staffing.client.project.<span>ProjectCreatorService</span>

Invoking com.google.<span>gwt</span>.<span>dev</span>.<span>javac</span>.<span>StandardGeneratorContext</span>@9b32fe

Generating client proxy for remote service interface 'com.<span>ryannorris</span>.staffing.client.project.ProjectCreatorService'

[ERROR] com.<span>ryannorris</span>.staffing.client.Action&lt;T&gt; has no available <span>instantiable</span> subtypes. (reached via com.<span>ryannorris</span>.staffing.client.Action&lt;T&gt;)

[ERROR]    subtype com.<span>ryannorris</span>.staffing.client.Action&lt;T&gt; is not <span>instantiable</span>

[ERROR]    subtype com.<span>ryannorris</span>.staffing.client.project.<span>ProjectCreatorAction</span> is not assignable to 'com.google.<span>gwt</span>.user.client.<span>rpc</span>.IsSerializable' or 'java.<span>io</span>.Serializable' nor does it have a custom field <span>serializer</span> (reached via com.<span>ryannorris</span>.staffing.client.Action&lt;T&gt;)

[ERROR] com.<span>ryannorris</span>.staffing.client.project.<span>ProjectCreatorAction</span> is not assignable to 'com.google.<span>gwt</span>.user.client.<span>rpc</span>.IsSerializable' or 'java.<span>io</span>.Serializable' nor does it have a custom field <span>serializer</span> (reached via com.<span>ryannorris</span>.staffing.client.Action&lt;T&gt;)</span></pre>
<p>I can&#8217;t say I ever had the pleasure of dealing with this bit of attention to detail from the GWT Compiler in the past.  And while I will readily admit I haven&#8217;t read every change to the underlying architecture that comes with 2.0, this would seem to be a piece that might be worthy of some special mention.</p>
<p><span>It is, of cour<span>se</span>, nearly common sen<span>se</span> to make sure that your RPC objects can go across the wire in the proper way, and thus simply respecting the semantics of java.<span>io</span>.<span>Serializable</span> the same way we would in EJB per <span>se</span>, is pretty reasonable.  Just a little more heads up would have been nice.</span></p>
<p><strong>Update 1: </strong>There seems to be some mention of <a title="RPC Compilation Feedback" href="http://code.google.com/p/google-web-toolkit/issues/detail?id=3461" target="_blank">fixing compiler feedback around RPC serialization here</a>.  But this defect doesn&#8217;t suggest changes that might have actually altered behavior or requirements of the compiler since 1.7.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/12/13/rpc-objects-in-gwt-now-must-be-serializable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Simple GWT Validation Framework Using Great Design Patterns and MVP</title>
		<link>http://www.ryannorris.com/2009/11/27/validation-in-gwt-with-mvp-and-patterns/</link>
		<comments>http://www.ryannorris.com/2009/11/27/validation-in-gwt-with-mvp-and-patterns/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 13:51:08 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Enterprise Architecture]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[Java Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[google web toolkit]]></category>
		<category><![CDATA[mvp]]></category>
		<category><![CDATA[ria]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=113</guid>
		<description><![CDATA[I&#8217;ve been writing a bit about Google Web Toolkit lately. It undeniably is disrupting traditional browser-based RIA development. But it does lack some features out of the box that most developers have grown accustomed to from frameworks like Flex and Ext. Field validation is one such feature. While the gwt-validation project exists to solve this [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been writing a bit about Google Web Toolkit lately.  It undeniably is disrupting traditional browser-based RIA development.  But it does lack some features out of the box that most developers have grown accustomed to from frameworks like Flex and Ext.  Field validation is one such feature.  While the gwt-validation project exists to solve this very problem, an approach leveraging a good chunk of the existing GWT infrastructure can give you a robust, test-driven, and MVP-friendly approach for validation.<span id="more-113"></span></p>
<p>To get started, let&#8217;s break down our validation needs along the standard lines that we see in frameworks today.  Widgets need to be able to be <em>Validatable</em>.  That is to say, Widgets must be able to be externally seen as having the capability to execute logic which validates their current state.  In my approach, I&#8217;ve chosen to <em>strategize</em> my widgets rather than visit them in order to validate their data.  This decision is largely to enforce contract-driven development and ensure a high level of testability.</p>
<p><strong>Validatable</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> Validatable <span style="color: #009900;">&#123;</span>
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Execute validation on the implementing component
	 *
	 * @return true if validation succeeded, false if validation failed
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> validate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We also now need an interface that will provide the rules for how validation logic should occur.  Something that is <em>Validatable </em>should be able to validate itself with multiple sets of rules.  Our <strong>Validator</strong> interface gives us this flexible cardinality, and has a familiar ring to it.</p>
<p><strong>Validator</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> Validator <span style="color: #009900;">&#123;</span>
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Execute the implemented validation logic
	 *
	 * @return true if validation succeeded, false otherwise
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> validate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Yes, these two interfaces are the same besides their name.  They are both command interfaces, allowing us to abstract logic behind a single method that we can cope with polymorphically.  The idea remember is that <em>Validatable</em> components can re-use many different <em>Validator</em> implementations.</p>
<p>So let&#8217;s write a simple <em>Validator </em>and <em>Validatable </em>interface.  In this case, we&#8217;ll be validating date input.</p>
<p><strong>DateFormatValidator</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.validator</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.gwt.i18n.client.DateTimeFormat</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.gwt.user.client.ui.HasValue</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.Validator</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> DateFormatValidator <span style="color: #000000; font-weight: bold;">implements</span> Validator <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> HasValue<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>String<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> _value<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> DateTimeFormat _format<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Create a validator that will verify that the given string is compliant
	 * with the pattern
	 *
	 * @param format
	 *            The format to validate against, per the specification in
	 *            {@link DateTimeFormat}
	 * @param value
	 *            The value to validate
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> DateFormatValidator<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> pattern, HasValue<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>String<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		_format <span style="color: #339933;">=</span> DateTimeFormat.<span style="color: #006633;">getFormat</span><span style="color: #009900;">&#40;</span>pattern<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Set the value to be validated
	 *
	 * @param value a string, nominally representing a date
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> setValue<span style="color: #009900;">&#40;</span>HasValue<span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>String<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		_value <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">/*
	 * (non-Javadoc)
	 *
	 * @see com.ryannorris.gwt.validation.client.Validator#validate()
	 */</span>
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> validate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			_format.<span style="color: #006633;">parse</span><span style="color: #009900;">&#40;</span>_value.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">IllegalArgumentException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// the value couldn't be parsed by the pattern, return false</span>
			<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So, now I have a <em>Validator. </em>How do I now make a widget, let&#8217;s say a simple TextBox, <em>Validatable?</em></p>
<p>Harkon back earlier when I said I was chosing to <em>strategize</em> my Widgets.  That&#8217;s only partially true.  Because we&#8217;re aiming for good TDD, and hence we want to rely on dependency injection &#8211; we will in fact be decorating them as well.  We will <em>strategize </em>around their ability to be validated, while we will <em>decorate </em>them with the <em>Validators</em> that interest us.  This is important, as we wouldn&#8217;t want to have 20 different TextBox implementations that handle various <em>Validation</em> permutations.  We would rather one, <em>decoratable</em> TextBox that can be managed by the presenter in our MVP implementation.  So what does our initial stab at a <em>ValidatableTextBox </em>look like?</p>
<p><strong>ValidatableTextBox</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.widget</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.gwt.user.client.ui.TextBox</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.Validatable</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.validator.DateFormatValidator</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ValidatableTextBox <span style="color: #000000; font-weight: bold;">extends</span> TextBox <span style="color: #000000; font-weight: bold;">implements</span> Validatable <span style="color: #009900;">&#123;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> validate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		DateFormatValidator validator <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DateFormatValidator<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mm/DD/yyyy&quot;</span>,
				getText<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">return</span> validator.<span style="color: #006633;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Wait, you say.  <em>This isn&#8217;t at all what you just described!  This is a text box that will only execute one validator for one date pattern! </em>Well, you&#8217;re right.  We need to find a way to enable decoration of our TextBox in a way that can be nicely tested and extensible.  GWT makes extensive use of decorator pattern, and really strives for testability.  We see this in the various <em>Has</em> interfaces, which are added to classes to give them additional behaviors (such as <em>HasText </em>or <em>HasClickHandler</em>).  So, we will follow suit and create our decorator interface <em>HasValidators.</em></p>
<p><strong>HasValidators</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> HasValidators <span style="color: #009900;">&#123;</span>
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Add a validator to the decorated component
	 *
	 * @param validator The validator to be added
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> addValidator<span style="color: #009900;">&#40;</span>Validator validator<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>And now our updated <em>ValidatableTextBox.</em></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.widget</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Set</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.gwt.user.client.ui.TextBox</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.HasValidators</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.Validatable</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.Validator</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> ValidatableTextBox <span style="color: #000000; font-weight: bold;">extends</span> TextBox <span style="color: #000000; font-weight: bold;">implements</span> Validatable, HasValidators <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">Set</span> _validators<span style="color: #339933;">;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> addValidator<span style="color: #009900;">&#40;</span>Validator validator<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		_validators.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span>validator<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">boolean</span> validate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">boolean</span> valid <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>Validator validator <span style="color: #339933;">:</span> _validators<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span> validator.<span style="color: #006633;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				valid <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">false</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">return</span> valid<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So, that&#8217;s pretty sweet. I have a collection of <em>Validators</em> as a member of the component &#8211; in fact I have a set of them as to ensure no <em>Validator</em> exists more than once on the component.  My <em>validate</em> method now loops through the set of validators and maintains the local state of the validation, allowing the entire validation to fail if any one <em>Validator</em> fails.</p>
<p>A highly testable <em>passive view</em> implementation with this component may look something like:</p>
<p><strong>MySampleValidatableView</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * 
 */</span>
<span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.gwt.event.dom.client.HasKeyPressHandlers</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.gwt.user.client.ui.HasValue</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 * @author ryan
 * 
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> MySampleValidatableView <span style="color: #009900;">&#123;</span>
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Get the {@link HasValidators} behavior of the date box.
	 * 
	 * @return a {@link HasValidators} behavior
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> HasValidators getDateValidators<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Get the {@link Validatable} behavior of the date box.
	 * 
	 * @return a {@link Validatable} behavior
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> Validatable getDateValidatable<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Return the {@link HasValue} behavior of the date box. This allows us to
	 * access the value of the control.
	 * 
	 * @return a {@link HasValue} behavior
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> HasValue<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> getDate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Return the {@link HasKeyPressHandlers} behavior of the date box. When the
	 * user types a key in the field, we will use this event to validate the
	 * current value;
	 * 
	 * @return
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> HasKeyPressHandlers getDateKeyUp<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #008000; font-style: italic; font-weight: bold;">/**
	 * Toggle the visual state of the date box so the user receives feedback
	 * when their date is valid
	 * 
	 * @param valid
	 *            Whether or not the control should reflect a valid date entry
	 *            (true) or an invalid one (false)
	 */</span>
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> toggleValidDateBox<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">boolean</span> valid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>A lot going on here, and it&#8217;s seems verbose &#8211; but it&#8217;s not, it&#8217;s just highly testable!  We need to be able to access the various behaviors of our text box so that we can test how our presenter<em> collaborates </em>with these behaviors.  We also need to be able to push the passive display functionality back to our view implementation so that our unit tests don&#8217;t inadvertently require a hosted environment to run.  So our presenter needs to be built to:</p>
<ol>
<li>Create a <em>DateFormatValidator</em> with the appropriate pattern and a reference to the component holding the text value to validate;</li>
<li><em>Decorate</em> the component in the view through the <em>HasValidators</em> behavior;</li>
<li>Execute validation whenever the user changes the value of the widget through the <em>HasKeyPressHandlers</em> interface;</li>
<li>Alter the visual display of the component by calling the <em>toggleValidDateBox</em> method.</li>
</ol>
<p>So last but not least, our presenter:</p>
<p><strong>MySamplePresenter</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.gwt.event.dom.client.KeyPressEvent</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.google.gwt.event.dom.client.KeyPressHandler</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">com.ryannorris.gwt.validation.client.validator.DateFormatValidator</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MySamplePresenter <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> MySamplePresenter<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">final</span> MySampleValidatableView view<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		DateFormatValidator validator <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DateFormatValidator<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mm/DD/yyyy&quot;</span>,
				view.<span style="color: #006633;">getDate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		view.<span style="color: #006633;">getDateValidators</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">addValidator</span><span style="color: #009900;">&#40;</span>validator<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		view.<span style="color: #006633;">getDateKeyUp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">addKeyPressHandler</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> KeyPressHandler<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			@Override
			<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onKeyPress<span style="color: #009900;">&#40;</span>KeyPressEvent event<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				view.<span style="color: #006633;">toggleValidDateBox</span><span style="color: #009900;">&#40;</span>view.<span style="color: #006633;">getDateValidatable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">validate</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So there you have it &#8211; a highly testable base for validation in a GWT application using MVP.</p>
<p>In my next post, I&#8217;ll add an event framework to validation, allowing asynchronous validation and abstraction between overall error handling and validation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/11/27/validation-in-gwt-with-mvp-and-patterns/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Does GWT Harkon the End of Javascript?</title>
		<link>http://www.ryannorris.com/2009/11/20/does-gwt-harkon-the-end-of-javascript/</link>
		<comments>http://www.ryannorris.com/2009/11/20/does-gwt-harkon-the-end-of-javascript/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 12:07:45 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Building Better Software]]></category>
		<category><![CDATA[Consulting]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=109</guid>
		<description><![CDATA[Javascript isn&#8217;t going away. But neither are 1&#8242;s and 0&#8242;s.  But one has to wonder what type of project or team that was looking to grow and build web-based, rich-client applications would actively choose to use Javascript on it&#8217;s own now. For my part, there&#8217;s only so much patience I have taking on the burden [...]]]></description>
			<content:encoded><![CDATA[<p>Javascript isn&#8217;t going away.  But neither are 1&#8242;s and 0&#8242;s.  But one has to wonder what type of project or team that was looking to grow and build web-based, rich-client applications would actively choose to use Javascript on it&#8217;s own now.</p>
<p>For my part, there&#8217;s only so much patience I have taking on the burden of supporting multiple browsers and dealing with performance issues.  Particularly if I&#8217;m Agile, and I&#8217;m focusing on delivering so much value so quickly, it&#8217;s very hard to explain to a client that the underlying technology creates significant overhead that adds drag to the project.  This is an even tougher sell &#8211; particularly when you&#8217;re open with your client, when alternatives that meet the non-functional needs exist.</p>
<p>For your standard web applications that aren&#8217;t as client-centric as today&#8217;s RIA applications, it&#8217;s certainly true that you are barking up the wrong tree with GWT.  Rails, Grails, and Zend can all give you the non-enterprise delivery tools that accelerate development from the server-side and leave the Javascript problem to be solved in a less holistic, more tactical way.</p>
<p>But it&#8217;s hard to argue now that anything short of the compilation semantics of GWT is useful in the RIA realm (without the need for a intermediate runtime, of course.)  Javascript is too costly and too brittle in large-scale applications to be subject to human hands.  If you&#8217;ve hired a contractor to build you a web-based RIA and they&#8217;re not using GWT &#8211; it&#8217;s well worth your wallet to ask them why.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/11/20/does-gwt-harkon-the-end-of-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Revenge of the Compiler &#8211; The Era of GWT and the Birth of Flash on the iPhone</title>
		<link>http://www.ryannorris.com/2009/10/13/revenge-of-the-compiler-the-era-of-gwt-and-the-birth-of-flash-on-the-iphone/</link>
		<comments>http://www.ryannorris.com/2009/10/13/revenge-of-the-compiler-the-era-of-gwt-and-the-birth-of-flash-on-the-iphone/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:38:31 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Building Better Software]]></category>
		<category><![CDATA[Java Development]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[GWT]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=96</guid>
		<description><![CDATA[For a while now, interpreted languages have reigned.  They were fast to develop in, cheap to build teams around, and were less strict about the rules of the road than many of their more strongly-typed brethren.  But as the modes of web application delivery have changed &#8211; indeed, as the modes of any sort of [...]]]></description>
			<content:encoded><![CDATA[<p>For a while now, interpreted languages have reigned.  They were fast to develop in, cheap to build teams around, and were less strict about the rules of the road than many of their more strongly-typed brethren.  But as the modes of web application delivery have changed &#8211; indeed, as the modes of any sort of software delivery has changed &#8211; the era of the interpreter is likely in decline.  As platforms are stretched to their limits and developers look for new ways to deploy high-performing, scalable web and mobile applications &#8211; an old friend emerges from the fog of battle to demonstrate why it was such a valuable innovation 50 years ago.  Compiled software is back &#8211; this time to once again relegate a past generation of development platforms to the same museum as assembly.</p>
<p><span id="more-96"></span>What <a title="Perl" href="http://www.perl.org" target="_blank">Perl</a>, <a title="PHP" href="http://www.php.net" target="_blank">PHP</a>, <a title="Python" href="http://www.python.net" target="_blank">Python</a>, and <a title="Ruby" href="http://www.ruby-lang.org/" target="_blank">Ruby</a> have done for application development, particularly classic web application development, has been nothing short of revolutionary.  Take C out of the picture.  Facade it with modern concepts that young developers can take to quickly and get results with.  Lose all accountability for memory management.  Push the heavy lifting to the open source teams maintaining these languages, let them deal with security concerns.</p>
<p>But in the last few years, web applications have changed.  The focus has shifted to moving state management and logic to the browser.  Rich internet applications aim to deliver experiences and tools that simply can&#8217;t be solved by these scripting languages or even their more heavy-handed older siblings, J2EE and ASP.Net.  Javascript is the new soup du jour.  A slew of abstractions have grown up around the limited facilities of Javascript, all trying to simplify this new mode of development through quirky but innovative approaches to DOM management, component reuse, and RPC.  But all of them are still Javascript.  All of them still take the code written by the engineer and with limited optimization execute it with the browser runtime.  As the complexity of these applications has scaled, the task of making them scalable and performant has become sisyphean.  Web developers have always needed to deal with issues of cross-browser compatibility, interactions with different operating systems, etc.  But now more and more we are talking about the limited capabilities of the browser itself and how it doesn&#8217;t manage memory in our Javascript applications the way that we are magically accustomed to.  For all the RIA frameworks we have today &#8211; Flash, Silverlight, JavaFX, etc., there&#8217;s still only one platform we can count on to deliver client-centric browser applications, and that&#8217;s Javascript.</p>
<p>So when the cost of delivering these solutions begins to increase incongruently with the complexity of the functionality we are looking to deliver, what are we to do?</p>
<p>An interesting thing happened the other day in the mobile application space.  iPhone development &#8211; typically the domain of pompous Mac owners like myself and a few willing Webkit jockeys, suddenly opened it&#8217;s doors to Adobe&#8217;s Flash platform.  After months &#8211; no, years of wrangling &#8211; Adobe has finally found a way to play on Apple&#8217;s lucrative mobile platform.  But this isn&#8217;t <a title="Keith Peters" href="http://www.bit-101.com/blog/?p=2410" target="_blank">Keith Peters&#8217;</a> Flash.  This is Actionscript being compiled magically into native iPhone runtime applications.  It&#8217;s a stunning development, one drawing ire and concern about performance.  But it&#8217;s not the first time that a development platform hailed for it&#8217;s scalability and ease of entry now has been used to usurp a underlying native platform which has proven to be a barrier in and of itself into development for the target platform.</p>
<p><a title="Google Web Toolkit" href="http://code.google.com/webtoolkit/" target="_blank">Google Web Toolkit</a> started the latest generation of application development, with it&#8217;s seeds in Microsoft .Net&#8217;s CLR.</p>
<p>As I noted, Javascript development today is hard.  It requires a significant amount of skill and experience to do right, and there&#8217;s simply not enough talent around to deliver the types of applications that every web site should be delivering.  There are fantastic software platforms written in C &#8211; but as we saw in the initial explosion of web applications, C is not a language that lends itself well to a pool of experienced and <em>cheap </em>labor.  PHP was that language.  Perl was that language.  It distilled down the concepts an engineer needed to know about to deliver a reliable application and simplified those concepts &#8211; memory management, semaphores, I/O, etc.  It allowed engineers to focus on solving the business problems of the dot-com boom and subsequent flurries of enterprise IT demands.  Now that the nature of those problems have changed &#8211; PHP as a tool is simply a square peg for a round hole.  And given the dreadful performance of our target operating environment, an interpreted language on top of Javascript is not an option.  What is an option is another language platform that could be compiled into JavaScript, complete with optimizations for memory management and portability.  GWT made Java the potential language of choice when it came to RIA development in Javascript.  It once again gave power back to engineers to be able to focus less on the non-functional needs of the application and put the focus back on fulfilling the functional requirements.</p>
<p>While the performance of GWT is stunning and it&#8217;s architecture a stark deja vu of past optimizations approaches to software compilation &#8211; our other example may not quite have the grit.  Compiling ActionScript to Objective-C is a nice trick, but may only solve the problem of heterogeneous development environments for Flash developers who haven&#8217;t had the guts yet to get into Cocoa development.  Natively, Objective-C is rather optimized, with device performance on the iPhone of platform applications running remarkably well.  So the compiler optimizations that web applications gain from GWT development aren&#8217;t really there.</p>
<p>But guns are certainly drawn on the problems of complex platform development, whether it be the arcane and aging Javascript platform in the modern web browser or the stifled promise of mobile application development.  For years, the complexity of executing a piece of software on a mainframe (or older system) acted as a significant barrier to delivery of commercial software.  The innovation of the compiler changed all of that.  Fast-forward 50 years later and we see the same problem, and the same solution is staring right at us.  The odd natural selection of software languages will repeat itself it seems.  Once again, the compiler saves the day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/10/13/revenge-of-the-compiler-the-era-of-gwt-and-the-birth-of-flash-on-the-iphone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating Your QA Staff with Engineering in SCRUM</title>
		<link>http://www.ryannorris.com/2009/08/14/integrating-your-qa-staff-with-engineering-in-scrum/</link>
		<comments>http://www.ryannorris.com/2009/08/14/integrating-your-qa-staff-with-engineering-in-scrum/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 11:53:24 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Project Teams]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[beck]]></category>
		<category><![CDATA[delivery]]></category>
		<category><![CDATA[fowler]]></category>
		<category><![CDATA[qa]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=88</guid>
		<description><![CDATA[As much as I love automated testing, I have come to live with the fact that teams migrating from waterfall approaches to development to SCRUM often try to maintain the team structures they are familiar with.  At times, this typically means an engineering staff that sucks at writing tests, and a QA staff that is [...]]]></description>
			<content:encoded><![CDATA[<p>As much as I love automated testing, I have come to live with the fact that teams migrating from waterfall approaches to development to SCRUM often try to maintain the team structures they are familiar with.  At times, this typically means an engineering staff that sucks at writing tests, and a QA staff that is still very much attuned to the finer grained edge and corner cases.  Each of these parts of your team adds value to a SCRUM project.  Integrating them to avoid bottlenecks, stay lean, and deliver with quality is a clever trick.</p>
<p><span id="more-88"></span>Engineers write code.  QA tests that code.  In the past, this baton model has been derived from extensive functional specifications and use case documents that break down the core, extension, and exception cases so that both the tests and software can be clearly defined.  In a waterfall model, this was functional as it mirrored the sequence of SDLC.  But SCRUM and most Agile processes really shun this kind of thinking and instead target flat teams that collectively own the deliverable.  As in a recent experience of mine, maintaining that same handoff creates all sorts of problems.  Acceptance and rejection of delivered stories occurs late in the game, QA is always in a rush to execute their tests, and product teams and development see QA as a bottleneck.  It&#8217;s tempting for management to look at this and begin to turn SCRUM into a series of miniature waterfalls.  But this is <strong>wrong.</strong> Instead, as with all things in SCRUM, the search for a solution needs to answer a few questions to make the possible actions palatable:</p>
<ol>
<li>Will the solution eliminate dependencies my team has?</li>
<li>Does this solution change the value that one set of skills adds to my team, or does it distribute it?</li>
<li>Will this solution be responsive to change?</li>
<li>Will this solution require extensive infrastructure to implement?</li>
</ol>
<p>Heroes <a title="Kent Beck" href="http://www.threeriversinstitute.org" target="_blank">Kent Beck</a> and <a title="Martin Fowler" href="http://www.martinfowler.org" target="_blank">Martin Fowler</a> will tell you that the best solution is to strive for full, automated testing.  I couldn&#8217;t agree more.  Manual testing, as Fowler recently said, should be considered &#8220;a human rights violation.&#8221;  It&#8217;s error prone, difficult to repeat, and handles regression poorly.  That said, there are some battles simply not worth fighting.  In larger, more established teams &#8211; this type of shift is glacial, largely because of the risk incurred by such a change in paradigm.  Pragmatism dictates that the value of your QA team be repurposed to continue to add value, though potentially in a different way.</p>
<p>If we can concede the anecdotal thought that most engineers are substandard at QA, then we can see a glaring gap on a SCRUM team.  Even full automated testing with xUnits and CI is going to relinquish some level of code coverage, particularly in legacy software that wasn&#8217;t designed to be tested 10 years ago.  It should be mandated in teams in this type of pickle that all future code adopt the best practices of TDD &#8211; even to the extent that older, less TDD-friendly technologies and architectures be phased out.  But as we engage a group of engineers in a methodology in which they may never have been educated, hired, or trained for &#8211; on the sidelines we have a group of people who have been identifying failure and success scenarios their entire careers &#8211; even if they aren&#8217;t engineers.  A QA team can be indispensible in this situation.</p>
<p>In your new, SCRUM-based project &#8211; QA no longer are the gatekeepers.  We can&#8217;t have multiple gatekeepers in SCRUM.  Instead we focus on delivery and acceptance, creating one gatekeeper &#8211; a single keeper of the truth: the product owner.  That role is intended to be their exclusive domain.  They are the most intimate with the domain, the most intimate with the user story, and the most knowledgeable of where value lies.  To vest these judgmental by proxy in a serial part of the development cycle only leads to confusion.  Who is really assessing value?  Who is ultimately going to decide whether or not a story can be delivered?  Who should decide whether it should be accepted?  The demographics of a SCRUM project exist to solve this very question.  Eroding the clarity of role simply detracts value.</p>
<p>So what does this mean?  QA can&#8217;t be relegated to the role of testing system.  They cannot be an analogue for some sort of software framework.  Our goal should be to migrate to full automation, even if that takes time.  This means that the role of QA changes to an engineering role.  Not in the software sense, but in developing the cases which need to be tested.  These will arise from:</p>
<ol>
<li>Conversational contributions to the story, noting and documenting constraints by guiding the product owner through different user experiences.  These can come out of user flows or non-functional prototypes.  But QA can add extensive value simply by contributing their ability to identify edge and corner cases that may not have been considered.  These may well not end up in our <em>confirmation</em> of the story, and it&#8217;s important for QA to recognize, just like with an engineer &#8211; that the value of a contribution in the conversation is to help shape the conversation, and not set requirements in the stead of the product owner.</li>
<li>Test cases derived from the constraints outlined in the conversation.  Take this user story:
<p><em>A user must be able to provide a credit card for payment of their order.  Each credit card must be validated with the issuer, and we will only accept credit cards from Visa and MasterCard.</p>
<p>Try it with Discover card.<br />
Try it with American Express.<br />
Try it with an invalid billing address.</p>
<p></em>This is the way that the product owner will ultimately accept the story.  The QA resource working on this story may write several test cases that test the edge and corner cases of the acceptance criteria, but they need to maintain an open conversation with the team to ensure they aren&#8217;t incidentally increasing scope by applying tests that go outside of the criteria.  So while the following test case is very likely to be something we&#8217;ll want to test:</p>
<p><em>Try a billing address where the street name is provided in all capital letters but matches the address on file which is entirely in lower case.  This is expected to be a positive case, with the validation succeeding.</p>
<p></em>This test would likely be considered an expansion of scope or otherwise invalid:</p>
<p><em>Try charging the card and ensure that we put a $5 hold on the card until the transaction is complete.</em></li>
</ol>
<p>So, in the cycle of the development of the story, the test cases serve as the outline for the engineer &#8211; as they should.  The engineer uses the tests to validate their code &#8211; or more effectively, runs their code against an automated test that implements the test case as defined by the QA specialist.  This helps improve quality and minimize risk by taking those decisions which we earlier agreed that engineers are poor at, out of their hands.  The test cases serve now as the same direction that the rest of the story does.  For those tests which remain manual for whatever reason, the effort to complete those tests can now be load balanced across the team, rather than vested in the hands of one point of failure in delivery.</p>
<p>Ultimately, this is what is so enjoyable about an Agile project.  Because it suggests solutions through it&#8217;s objectives, it&#8217;s possible to solve any execution concern by referring back to the principles that make Agile delivery successful.  Being able to respond to change, emphasize people and interactions, and prefer generalization over specialization is the guidance we can use to look at the role of the heroic QA team in a different light &#8211; a somewhat specialized engineering team that delivers artifacts that infuse delivery with the value that it may not be realizing in engineering, and not acting as a secondary source of truth for the team.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/08/14/integrating-your-qa-staff-with-engineering-in-scrum/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An Omniscient Learning Approach to Mock-based TDD</title>
		<link>http://www.ryannorris.com/2009/04/16/an-omniscient-learning-approach-to-mock-based-tdd/</link>
		<comments>http://www.ryannorris.com/2009/04/16/an-omniscient-learning-approach-to-mock-based-tdd/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 03:29:31 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Building Better Software]]></category>
		<category><![CDATA[Enterprise Architecture]]></category>
		<category><![CDATA[Java Development]]></category>
		<category><![CDATA[Services as Software]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=69</guid>
		<description><![CDATA[I recently posted about why I think mocks are simply the easiest way to get the most bang for your buck in automated software testing.  But integrating it as part of a process is hard, and teaching it is even harder.  Young developers seem to have a hard time grasping the idea of testing isolated [...]]]></description>
			<content:encoded><![CDATA[<p>I recently posted about why I think mocks are simply the easiest way to get the most bang for your buck in automated software testing.  But integrating it as part of a process is hard, and teaching it is even harder.  Young developers seem to have a hard time grasping the idea of testing isolated units of code.  I&#8217;ll confess &#8211; for a long time, much of my unit testing involved setting up the appropriate test environments &#8211; Spring containers for persistence units, test databases, you name it.  It&#8217;s expensive to test this way, and there are only so many situations when integration tests are valuable.  On lean, agile teams &#8211; code coverage isn&#8217;t held in as high regard as having working software.  On lean, agile teams &#8211; tests are a driver towards design, but they do need to be rooted in some level of initial thought on how a problem needs to be solved.</p>
<p><span id="more-69"></span></p>
<p>So understanding how a unit test is traceable back to a technical design on an agile team is really a key differentiation between an approach that more closely resembles cowboy coding and an approach which is relatively holistic.  No scrum master, project manager, or even architect would advocate full designs in an agile environment &#8211; instead we opt for lighter weight approaches to technical design that provide a blueprint to the code.  For many teams, this is a CRC card &#8211; a simply way of documenting the various dimensions of an object-oriented unit.</p>
<p>What is a CRC, and how does it relate back to tests?</p>
<p><strong>Class</strong></p>
<p>The core unit of code that we will refer to is the class, but this can be really any aggregation &#8211; a function library even.  This represents a loose collection of related functionality that leverages common resources, represents a concept of actions or identity, or extends existing functionality.</p>
<p><strong>Responsibilities</strong></p>
<p>The responsibilities of the class form it&#8217;s <em>raison d&#8217;etre. </em>Commonly, we can analogize responsibilities with methods, but they may be more coarse grained &#8211; and our refactoring may indeed refine the level of detail with which we understand the functional responsibilities of the class.</p>
<p><strong>Collaborators</strong></p>
<p>From an interestingness perspective, particularly in the context of unit testing and mocking (or stubbing), collaborators really take the cake.  When we talk about <em>dependency injection</em> as the core pattern of test-driven development with mocks, collaborators are indeed what we are injecting into our class to power it.</p>
<p>I always ask my green developers to think about these things before starting any sort of development.  Once their CRC is done and we agree on the approach, I ask them to build the programming interface, stub the implementation, and then start writing tests.  A common example I like to use when I get that befuddled look is the idea of a car.  A car has a lot of complex stuff going on that if I needed to test dependent functions of the car against, I wouldn&#8217;t want to have to concoct all of the function they provide.  For instance, the engine is a complex piece of machinery &#8211; but if I solely want to to test how my transmission reacts to engine behavior &#8211; it&#8217;s the transmission class I want to ultimately test, and it&#8217;s reactions to different engine behavior.</p>
<p>Let&#8217;s bring it up a level and talk about a Car as the core class.  We want our car to be able to do two things &#8211; to have two <em>responsibilities</em>: accelerate and stop.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> Car <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">int</span> accelerate<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> additionalVelocity<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000066; font-weight: bold;">void</span> setTireGrip<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> gripFactor<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000066; font-weight: bold;">int</span> stop<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> overDistance<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> CannotStopException<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> Motorable <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">int</span> injectGasoline<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> mlOfFuel<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> Stoppable <span style="color: #009900;">&#123;</span>
   <span style="color: #000066; font-weight: bold;">int</span> applyBrakes<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PadException, RotorException, WetRoadException<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>So we&#8217;ve defined 3 interfaces.  Let&#8217;s say that I&#8217;m really interested in a case where I test how the car reacts to different stopping conditions.  Now, I&#8217;m demonstrating this in Java, so I&#8217;ll use syntax similar to Mockito &#8211; but the rules are the same:  I&#8217;m interested in testing the requirements of the car <em>observing the expected behavior of the brakes in those conditions</em>.  When the grip is set low, we expect the braking system to respond negatively and lock up.</p>
<p>We&#8217;ll also assume for now that I&#8217;ve stubbed out a skeletal implementation of the Car interface (meaning that everything throws a NotImplementedException for the time being).</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">@Test
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testWetRoadConditionsWithLowFriction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
   <span style="color: #666666; font-style: italic;">// arrange</span>
   Stoppable s <span style="color: #339933;">=</span> mock<span style="color: #009900;">&#40;</span>Stoppable.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   Motorable m <span style="color: #339933;">=</span> mock<span style="color: #009900;">&#40;</span>Motorable.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   Car c <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CarImpl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   c.<span style="color: #006633;">setStopAbility</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   c.<span style="color: #006633;">setMotor</span><span style="color: #009900;">&#40;</span>m<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   c.<span style="color: #006633;">setGripFactor</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   when<span style="color: #009900;">&#40;</span>s.<span style="color: #006633;">applyBrakes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">thenThrow</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> WetRoadException<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// act and assert - no real assertion, we're expecting an exception</span>
      c.<span style="color: #006633;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      fail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Should have seen a CannotStopException - there's not a lot of grip for road when road conditions are wet&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span><span style="color: #009900;">&#40;</span>CannotStopException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// do nothing, we're a success!</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>As you can see, we&#8217;re not actually testing the brakes &#8211; we&#8217;re testing that under the given conditions that when the Stoppable interface throws an exception that prevents our car from stopping successfully that we are throw our own CannotStopException in response.  The stoppable interface is a <em>collaborator</em>; we are not interested in this case in unit testing it, we are interested in asuming a known behavior from it, and testing how the stop() ability of the Car implementation reacts to the WetRoadException that we have stubbed.</p>
<p>The alternative in the past would have been to actually create the implementation of Stoppable.  But having to unit test both items makes it difficult to isolate implementation issues.</p>
<p>So ultimately young developers, your unit tests need to test a single responsibility and not the responsibility of your collaborators.  You may eventually test how the two implementations interact &#8211; that is an integration test.  Ultimately though, there is more value in testing each individual unit and ensuring that the code is built to the spec of your lightweight design.  Then you can isolate integration issues and write tests that specifically address finding integration problems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/04/16/an-omniscient-learning-approach-to-mock-based-tdd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Piling on Praise for Apache Wicket</title>
		<link>http://www.ryannorris.com/2009/04/13/piling-on-praise-for-apache-wicket/</link>
		<comments>http://www.ryannorris.com/2009/04/13/piling-on-praise-for-apache-wicket/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 12:20:57 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Building Better Software]]></category>
		<category><![CDATA[Enterprise Architecture]]></category>
		<category><![CDATA[Java Development]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=66</guid>
		<description><![CDATA[I think someone finally got a web framework for Java right. While I&#8217;m still yet to try on some of the AJAX support &#8211; something that makes or breaks a web framework these days &#8211; Wicket&#8216;s clear separation of concerns and robust architecture for MVP (right, &#8216;P&#8217;, as in Model-View-Presenter) has really impressed me.  Generally [...]]]></description>
			<content:encoded><![CDATA[<p>I <strong>think </strong>someone finally got a web framework for Java right.</p>
<p>While I&#8217;m still yet to try on some of the AJAX support &#8211; something that makes or breaks a web framework these days &#8211; <a title="Wicket" href="http://wicket.apache.org" target="_blank">Wicket</a>&#8216;s clear separation of concerns and robust architecture for MV<em>P</em> (right, &#8216;P&#8217;, as in Model-View-Presenter) has really impressed me.  Generally speaking, I have not been one to embrace convention over configuration in frameworks like RoR, simply because it seems non-scalable.  But given it&#8217;s pure focus on UI and it&#8217;s total flexibility to do whatever the hell I want with my middle tier, I&#8217;m feeling that when restricted to the presentation layer &#8211; the paradigm works.  Wicket is pretty programmer-centric, so unlike RoR, you&#8217;re not going to get off the ground without some skills or a scaffolding framework like <em>Wicketopia</em>, but I&#8217;m not at all convinced this isn&#8217;t a bad thing.</p>
<p>There are a couple of things that I could get enthusiastic with around Wicket, were someone &#8211; including myself &#8211; to improve them.</p>
<ol>
<li><strong>Documentation. </strong>Look, I hate documenting things as much as the next guy &#8211; but in as much as I&#8217;ve enjoyed the fruits of my labor in Wicket, I have not enjoyed chasing down information to all ends of the globe.  I love the fact that this is working software, and the curve isn&#8217;t too steep &#8211; but try finding stuff on form validation, or the entire concept of mounting URL paths.</li>
<li><strong>Callbacks, anyone? </strong>So, forms in Wicket generally appear to be processed by the <strong>onSubmit()</strong> method of the Form class.  You override this in your child class of form.  This is the very object-oriented way of doing things, but it seems a touch limiting out of the box to not be able to register callbacks on this method.  My <strong>Form</strong> class exists so that I can have more than one of these per page, no doubt (take <em>THAT</em> ASP.NET), but I still think that I&#8217;d like to be able to actually register callback handlers as I wish in each <strong>Page</strong>, thus allowing Forms to have different behaviors dependent on where they are used.  I&#8217;m pretty sure this isn&#8217;t the 80% use case, but I still am left with only one alternative out of the box, and that&#8217;s to keep extending the class hierarchy.  It&#8217;s nice to embrace strategy pattern and all, but to me this is where we really need an observer.
<p>So I was able to fudge this myself by creating a <strong>FormSubmitListener </strong>interface, subclass <strong>Form </strong>and implement it&#8217;s <strong>onSubmit()</strong> to call the <strong>formSubmitted()</strong><em> </em>method from my new interface, it&#8217;s own implementation registered through the constructor on my <strong>Form</strong> subclass &#8211; but I think in an MVP or MVC framework, I still would like the ability to use OOP to handle the quirks of the page lifecycle (yeah, yeah &#8211; Wicket is unmanaged), but allow observers to actually handle pseudo-user events.</li>
</ol>
<p>These two things aside, I feel pretty at peace with Wicket as my web framework for Java projects going forward (sorry Seam).</p>
<p>Another note &#8211; I&#8217;m really interested in the possibilities of packaging all of the resources for the web project in the JAR file.  While WAR&#8217;s are fine for deployment, JAR&#8217;s make the application open for truly modular design.</p>
<p>Now to refresh my memory on getting JTA running in a pure servlet container&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/04/13/piling-on-praise-for-apache-wicket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mocks &#8211; the only thing separating complex TDD from value-added TDD</title>
		<link>http://www.ryannorris.com/2009/04/08/mocks-the-only-thing-separating-complex-tdd-from-value-added-tdd/</link>
		<comments>http://www.ryannorris.com/2009/04/08/mocks-the-only-thing-separating-complex-tdd-from-value-added-tdd/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 03:18:05 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Building Better Software]]></category>
		<category><![CDATA[Enterprise Architecture]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[integration testing]]></category>
		<category><![CDATA[mockito]]></category>
		<category><![CDATA[rhinomocks]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[unit testing]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=64</guid>
		<description><![CDATA[About two years back when I started getting completely fascist about test-driven development, the complexity was always &#8220;gee, i have an application container and I need to involve it in my unit tests so that I can get full test coverage !!111oneeleventy.&#8221; This typically meant providing a real collaborator, like a PersistenceUnit in Java, so [...]]]></description>
			<content:encoded><![CDATA[<p>About two years back when I started getting completely fascist about test-driven development, the complexity was always &#8220;gee, i have an application container and I need to involve it in my unit tests so that I can get full test coverage !!111oneeleventy.&#8221;</p>
<p>This typically meant providing a real <em>collaborator</em>, like a PersistenceUnit in Java, so that I could test trivial operations like persisting an entity.  At the time, I challenged a manager on this:</p>
<p><em>What are we really testing?  Are we testing OUR requirement, or are we testing something we should reasonably expect Hibernate to do on the basis of our initial technology selection?</em></p>
<p>Code coverage I believe is pretty overrated.  No one cares whether or not you can prove your method to persist an entity works <strong>because the developers of Hibernate/TopLink/LINQ to SQL have already proved this through their unit tests. </strong>What you are building when you write a test that actually checks the database to see if <em>your middleware </em>used a pre-packaged <em>object-relational manpping framework</em> correctly is an integration test.  There&#8217;s certainly value to integration testing with data access layers, particularly when difficult to test components of your middleware (like stored procedures and triggers) are involved.  Saving that however, the focus of test-driven development &#8211; namely unit tests, should be on the business logic that is proprietary to your applicatiom, be it the front-end or the middle tier.</p>
<p>Now, suffice to say that to a good number of developers and architects this isn&#8217;t news, but if you really want to <em>isolate</em> the code which you wrote that is specific to your business rules and requirements &#8211; <strong>mocking frameworks</strong> are the way to go.  Particularly in an Agile project where we can readily identify certain injected dependencies (like an EntityManager, for example) as a <em>collaborator </em>of the class under test, your unit test is really interested in asking the question <em>based on this interaction with this external component, how should I expect my logic to react?</em></p>
<p>In these scenarios of course, I mock or stub the <em>EntityManager</em>.  In the past, a fool like me would have tried to load a container within my unit test environment.  This is actually an integration test, in addition to the fact that it is costly and doesn&#8217;t add the value a truly isolated unit test which focuses on the code <em>you wrote</em> does.</p>
<p>In .Net, <a title="RhinoMocks" href="http://ayende.com/projects/rhino-mocks.aspx" target="_blank">RhinoMocks</a> is scalding hot with it&#8217;s supprt for mocking through lambda&#8217;s.  In JEE, I&#8217;ve fallen in love with <a title="Mockito" href="http://mockito.org/" target="_self">Mockito</a>.</p>
<p>So, stop worrying about how you can get JBoss running so that your CI environment can execute inside of it.  Instead, use mocks to give your code the resources it needs to vet out the conditions in your own code that you want to test.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/04/08/mocks-the-only-thing-separating-complex-tdd-from-value-added-tdd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Diving back into Java, and liking it (mostly)</title>
		<link>http://www.ryannorris.com/2009/04/08/diving-back-into-java-and-liking-it-mostly/</link>
		<comments>http://www.ryannorris.com/2009/04/08/diving-back-into-java-and-liking-it-mostly/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 15:53:14 +0000</pubDate>
		<dc:creator>Ryan Norris</dc:creator>
				<category><![CDATA[Building Better Software]]></category>
		<category><![CDATA[Enterprise Architecture]]></category>
		<category><![CDATA[Java Development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[wicket]]></category>

		<guid isPermaLink="false">http://www.ryannorris.com/?p=60</guid>
		<description><![CDATA[So for various reasons, I&#8217;ve pulled Eclipse Ganymede down and decided to check in on where Java has gone during my year-long mental hiatus in Redmond.  I have certain biases now from the land of .Net, and god help the Java world if it angers me after seeing the things I&#8217;ve seen in the last [...]]]></description>
			<content:encoded><![CDATA[<p>So for various reasons, I&#8217;ve pulled Eclipse Ganymede down and decided to check in on where Java has gone during my year-long mental hiatus in Redmond.  I have certain biases now from the land of .Net, and god help the Java world if it angers me after seeing the things I&#8217;ve seen in the last year.</p>
<p>All in all, I&#8217;m very pleased.</p>
<p><strong>The m2eclipse plugin is marvelous, finally.</strong></p>
<p>The day has finally come where I&#8217;m no longer fighting <a title="Eclipse" href="http://www.eclipse.org" target="_blank">Eclipse</a> to build projects using <a title="Maven" href="http://maven.apache.org" target="_blank">Maven</a>, as it should be.  Maven ties far too many niceties of the world together, and to not have it as the underlying, portable build tool within the IDE has always frustrated me.  The ability to quickly start a new Maven project, apply an archetype and go is fantastic.  The fact that it doesn&#8217;t require special jazz to get a WTP project up and running is even better.</p>
<p><strong>Hey look, working with my database and some JPA implementation is really easy!</strong></p>
<p>&#8230;well, almost easy.  I created a project for my middleware just using the quickstart archetype.  I was just going to throw Spring on top of it and avoid spoiling the good experience so far with EJB insanity.  The next thing I wanted to do was load up my database tables as ORM classes via Hibernate.</p>
<p>For whatever reason, this was cool on my Mac.  Project Properties&#8230;JPA Tools&#8230;Generate entities.  This is somehow not the way to do it over in windows.  So instead I tried to add JPA as a project facet.</p>
<p>My first problem was that I didn&#8217;t have Hibernate set up as my default JPA provider.  Unfortunately, you can only do this through the Maven-managed dependencies.  It has to be an Eclipse user library.  So I download the Entity Manager and wire it up into Eclipse.  Add the Java Facet (somehow <strong>not a default</strong>, probably Maven&#8217;s fault), added the JPA Facet (and am told I need to add the Utility Facet, so I do that).</p>
<p><em>Further configuration required.</em></p>
<p>Ok.  So I click into this further configuration and it reasonably wants to know how I connect to the database.  Fair enough.  I do all this, and it still won&#8217;t let me apply the change.</p>
<p>Eventually, it appears you need to add the Java project facet <em>first</em>, and then and only then can I reopen the properties page and apply the JPA facet.  A frustration point, but I figured it out.</p>
<p><strong>Hey, nothing special to get a project with the Wicket archetype running in WTP.</strong></p>
<p>I start a separate web project and use the <a title="Wicket" href="http://wicket.apache.org" target="_blank">Wicket </a>archetype, interested in tackling what looks to be a nice, lightweight UI package for Java (though it looks like <a title="Spring Framework" href="http://www.springframework.org" target="_blank">Spring </a>integration isn&#8217;t trivial &#8211; which is basically unacceptable these days).  I start the project, I add a server configuration, and deploy&#8230;</p>
<p><em>Holy crap, it works out of the box!</em></p>
<p>I have a ways to go, but things feel more turnkey with Eclipse than I&#8217;ve ever experienced.  I did up some JUnits with Mockito, and that was easy, indicating that if I were to set up Cruise or some other CI tool, I could quickly get going with a full Agile project.  Exciting stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryannorris.com/2009/04/08/diving-back-into-java-and-liking-it-mostly/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
