<?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>robjam.es &#187; Software</title>
	<atom:link href="http://robjam.es/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://robjam.es</link>
	<description></description>
	<lastBuildDate>Tue, 20 Mar 2012 18:40:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting to &#8220;Done&#8221;</title>
		<link>http://robjam.es/2012/01/getting-to-done/</link>
		<comments>http://robjam.es/2012/01/getting-to-done/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 20:40:41 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[General News]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Start Ups]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=469</guid>
		<description><![CDATA[How do you know when you are finished? This can be quite difficult. You are working on something and you need to get that deliverable finished; a document, a piece of code, a project, a building or a Lego creation. But when do you now you are done? This can be extra hard if you... <a href="http://robjam.es/2012/01/getting-to-done/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p>How do you know when you are finished? This can be quite difficult.</p>
<p>You are working on something and you need to get that deliverable finished; a document, a piece of code, a project, a building or a Lego creation. But when do you now you are done?</p>
<p>This can be extra hard if you consider yourself to be a perfectionist!</p>
<p>There are a four rules that I would suggest to follow;</p>
<ol>
<li>Visualize &#8220;done&#8221; from the start. Before you get started define what getting it done means. What is that end state, and ask yourself the question &#8220;could I get to &#8216;done&#8217; earlier?&#8221;, &#8220;what compromises can I make to get finished sooner?&#8221;</li>
<li>Use tools to test being finished. Test Driven Development does this well. Coders are encouraged to write tests that only confirm the required functionality has been delivered. This discourages over-engineering. Once the tests pass, you&#8217;re done!</li>
<li>Assess as you go. This means asking yourself whether you are &#8216;really&#8217; finished, or do you have more to do. What if you stop now, what are the negative impacts, and how much value are you providing by doing the extra work on this &#8216;thing&#8217;? Would there be more value moving onto the next &#8216;thing&#8217;?</li>
<li>Accept the 80/20 rule. Accept that it takes 20% of the effort to get to 80% of the finished product. Is it really worth spending that additional 80% of your time, to fill that final 20%?</li>
<li>Leave something to do. There is always room for improvement, but make that assessment after your product has been used, your document has been read, or your room has been lived in. You will never get it 100% right the first time round and once you start using your deliverable, you will find ways to improve.</li>
</ol>
<p>There are of course some exceptions to the above, and you also need to question whether what you are currently working on is one of those exceptions (brain surgery comes to mind, you kind of want to get that perfect the first time!)?</p>
<p>But imagine how much more productive you could be if you could commit to finishing things earlier?</p>
<p>So hurry up and get to &#8220;done&#8221;!</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2012/01/getting-to-done/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visitor Retention: Infographic</title>
		<link>http://robjam.es/2011/09/visitor-retention-infographic/</link>
		<comments>http://robjam.es/2011/09/visitor-retention-infographic/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 22:01:15 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[General News]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=446</guid>
		<description><![CDATA[Came across this really interesting infographic about customer retention. The focus is on gaming, but at a high level, the key points are critical and most often forgotten. Source: From the great mixpanel blog on gaming, http://blog.mixpanel.com/2011/09/16/infographic-what-you-should-know-about-visitor-retention/]]></description>
			<content:encoded><![CDATA[<p>Came across this really interesting infographic about customer retention. The focus is on gaming, but at a high level, the key points are critical and most often forgotten.</p>
<div id="attachment_447" class="wp-caption aligncenter" style="width: 60px"><a href="http://robjam.es/wp-content/uploads/2011/09/retention-infographic.png"><img class="size-medium wp-image-447 " title="retention-infographic" src="http://robjam.es/wp-content/uploads/2011/09/retention-infographic-50x300.png" alt="" width="50" height="300" /></a><p class="wp-caption-text">Click to Enlarge</p></div>
<p>Source: From the great <a href="http://blog.mixpanel.com/" target="_blank">mixpanel </a>blog on gaming, <a href="http://blog.mixpanel.com/2011/09/16/infographic-what-you-should-know-about-visitor-retention/" target="_blank">http://blog.mixpanel.com/2011/09/16/infographic-what-you-should-know-about-visitor-retention/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/09/visitor-retention-infographic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Architectural Deck &#8211; A great example</title>
		<link>http://robjam.es/2011/07/architectural-deck-a-great-example/</link>
		<comments>http://robjam.es/2011/07/architectural-deck-a-great-example/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 22:40:53 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=442</guid>
		<description><![CDATA[The other day I talked about the concept of an Architectural deck to describe a blueprint for making decisions. And there is a great example of a well architected solution that we can test the hypothesis of the Architectural Deck against &#8211; The Human Body. Just a reminder, there are 3 layers to our deck; Foundational &#8211;... <a href="http://robjam.es/2011/07/architectural-deck-a-great-example/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://robjam.es/2011/07/the-architecture-deck-an-introduction/">other day</a> I talked about the concept of an Architectural deck to describe a blueprint for making decisions. And there is a great example of a well architected solution that we can test the hypothesis of the Architectural Deck against &#8211; The Human Body.</p>
<p>Just a reminder, there are 3 layers to our deck;</p>
<ol>
<li>Foundational &#8211; The core and basis that we have to work with</li>
<li>Functional &#8211; The tried and tested solutions</li>
<li>Innovational &#8211; The things that make the solution different or special</li>
</ol>
<p>If we try and correlate this to the human body, or more specifically a component of the human body such as the legs. This may be described in the following way;</p>
<h3>Foundational</h3>
<p>If we look at the human legs, there are some very specific core capabilities that they have, such as balancing upright, being able to move a person around and the materials that are used to construct them; carbon based, organic material to create skin, bones, muscles, nerves and the blood that fuels the cells. This is foundational as its <strong>core</strong> to the human legs. And the observant ones out there would have recognised &#8220;well, that&#8217;s not unique to human legs!?&#8221; And how right you are! This is a great example of the core capabilities that most animals with legs have (give or take), and so we are working with something that has been proven. The <em>&#8220;give or take&#8221; </em>takes us to the next layer; functional.</p>
<h3>Functional</h3>
<p>Human&#8217;s can walk, run, jump and do a variety of different things with their legs. But there are some tried and tested methods that have been employed. For example, there is nothing stopping you from walking backwards with you legs wide a part and feet pointing outwards (granted, it would be difficult). But the point is, we humans typically don&#8217;t walk that way. We have adopted &#8216;best practices&#8217; in walking, we use our hips, bend our knees, put one foot in front of the other etc. So although there are many ways to handle movement with our legs, to get the most optimised functional movement from them, we adopt this best practice.</p>
<p>As an aside, think of the down stream benefits here. Pediatrists have been treating well known issues based on these best practices, how do you think they would go treating you if you always walked the way described above? Shoe&#8217;s are designed based on this premise of walking. There are many other <em>support</em> benefits.</p>
<h3>Innovational</h3>
<p>So what are the exciting innovational aspects that we can attribute to legs? Firstly, the fact that humans effectively walk upright, which would gives us the competitive advantage against certain other animals. But that is not fair, we should compare apples with apples. So think about the well oiled machine that is an sprint runner. Their muscles are finely tuned for explosive strength that is converted to speed. This is different to a marathon runner that is focussing on stamina. Sprint runner&#8217;s bones are strengthened, and the the other systems in their body (lungs, heart etc) work hand in hand to provide this competitive advantage. Although they may have the same make up, they have innovated in how they train and focus on key parts of their legs that sets them above others.</p>
<p>Can you think of other examples?</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/07/architectural-deck-a-great-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Architecture Deck &#8211; An Introduction</title>
		<link>http://robjam.es/2011/07/the-architecture-deck-an-introduction/</link>
		<comments>http://robjam.es/2011/07/the-architecture-deck-an-introduction/#comments</comments>
		<pubDate>Sat, 02 Jul 2011 02:56:12 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[General News]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=433</guid>
		<description><![CDATA[Enterprise Architecture is an important practice that has come out in the last 10 years. To me, its an attempt at the &#8216;grand unified theory&#8216; in business &#38; technology. And of the most important models within Enterprise Architecture is to derive the Business Architecture which sits at the top of this tree. After discussing this... <a href="http://robjam.es/2011/07/the-architecture-deck-an-introduction/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Enterprise Architecture is an important practice that has come out in the last 10 years. To me, its an attempt at the &#8216;<a href="http://en.wikipedia.org/wiki/Grand_Unified_Theory" target="_blank">grand unified theory</a>&#8216; in business &amp; technology. And of the most important models within Enterprise Architecture is to derive the Business Architecture which sits at the top of this tree. After discussing this with a number of people, I have got some traction to a concept I have been talking about for a while that I call it the &#8220;Architecture Deck&#8221;.</p>
<p><a href="http://robjam.es/wp-content/uploads/2011/07/Architectual-Deck.jpg"><img class="aligncenter size-full wp-image-434" title="Architectual Deck" src="http://robjam.es/wp-content/uploads/2011/07/Architectual-Deck.jpg" alt="" width="293" height="174" /></a></p>
<p>The Architecture Deck is a framework to try and conceptualise the layers of an architecture that helps make business decisions. What is great about this deck is that can quite easily be used to architect a city, a house, an enterprise, a startup, a team or a product, or absolutely anything that  can get value from an architectural blueprint.</p>
<p>I&#8217;m a big proponent of simple models, and this is about as simple as they get, but you will see in the next series of posts, how it is quite powerful.</p>
<p>Lets start today with explaining the layers (from the bottom);</p>
<h3>Foundational</h3>
<p>This is the lowest part of the deck, and it describes the most foundational aspects to an architecture. Its where tried and tested, and industry standards (beyond best practices) are employed. You will 99% of the times, engage this in your architectural solution, as there is no benefit to your architectural model to go outside of this. Examples would be the need to have sewerage in a city plan, or cement slab for a house, use IP networks to interconnect computers in an office environment, or use a relational database for storage in a software product. Sure there are other alternatives, but for your current purpose, there is no benefit to go outside of this. This will be described in more detail in future posts.</p>
<h3>Functional</h3>
<p>The functional layer describes the aspects of the architecture that have many differentiators or competitors, so you have some choice. But this is isolated for 2 special reasons; a) things here do not provide your city, business or product with a competitive advantage, &amp; b) in immature architectures where this is not articulated, every architecture has their own version of it. This is critically important, as what we are trying to identify here is the concept of engaging best practices. Examples here could be a Rail Network in a city, the type of timber floorboards you put in a house, the order process in an enterprise, or software pattern you use in your product. As I&#8217;m sure you have already realised, there are many choices with all these examples, but the question that must be asked, &#8220;Is there any advantage in trying to be unique here, or are we best to use the methods that others have tried, tested, failed and then got right?&#8221;</p>
<h3>Innovational</h3>
<p>This is the most exciting layer!! This describes what makes your architecture different. What makes New York a great city that others try hard to imitate, why everyone in your street wants a house just like yours, why your office can process sales orders faster than anyone else, or what makes the iOS such a unique OS for Apple that everyone is imitating it! Its the competitive advantage, its the unique streak, and its the innovation that occurs in a city, house design, office operations or software product!</p>
<p>I appreciate that this is all quite esoteric, and the details will come out in future posts, but essentially the basics described here are all that you need to help you make decisions. In future posts we&#8217;ll get into the details, we will also look at some real world examples, and we&#8217;ll discuss how you can work out your own Architectural Deck.</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/07/the-architecture-deck-an-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s wrong with Grails Searchable?</title>
		<link>http://robjam.es/2011/04/whats-wrong-with-grails-searchable/</link>
		<comments>http://robjam.es/2011/04/whats-wrong-with-grails-searchable/#comments</comments>
		<pubDate>Wed, 27 Apr 2011 01:33:45 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=413</guid>
		<description><![CDATA[I have been a huge fan of the Grails Searchable plugin, and its one of the main selling points when I talk to people about Grails. But something has made me go sour on it recently. A great blog post from Boris Goykhman about the plugin has prompted me to write my own. For those of... <a href="http://robjam.es/2011/04/whats-wrong-with-grails-searchable/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I have been a huge fan of the Grails Searchable plugin, and its one of the main selling points when I talk to people about Grails. But something has made me go sour on it recently. A <a href="http://groovytard.blogspot.com/2011/04/quick-journey-through-grails-searchable.html" target="_blank">great blog post from Boris Goykhman</a> about the plugin has prompted me to write my own.</p>
<p>For those of you that don&#8217;t know; <a href="http://www.grails.org/plugin/searchable" target="_blank">Searchable plugin</a> is a plugin wrapper in the Grails Framework for the <a href="http://www.compass-project.org/" target="_blank">Compass Search</a> engine that abstracts much of the domain class to search index mappings. And Compass is an extended implementation of the robust <a href="http://lucene.apache.org/java/docs/index.html" target="_blank">Open Source Lucene search engine</a>. But its the &#8220;Domain Model to Search Index&#8221; abstraction that has cause for concern.</p>
<p>So lets start &#8211; I think Searchable is absolutely brilliant!!! It simplifies the process of adding a search engine to a Grails application. Although apart from some straight forward indexing and searching, I don&#8217;t believe its designed to handle complex search scenarios. Sure, you can spend a lot of time bastardising your application to support many of the elements (such as searchable component and searchable reference) to try and get deep nested relationships correctly mapped, but more often than not, I find myself also bastardising my domain model to handle what I want search to do!!</p>
<p>I will continue to use searchable for basic type search mappings, but I have recently decided that it is more efficient to separate the concerns between domain data and search indexes. Domain models are inherently a tree structure, there are relationships, abstractions and extensions. Whereas your search index is a flattened version of this. And trying to do this flattening through decorators and mapping files is not effective.</p>
<p>In a recent project, I took the approach to handling the domain to search indexing data structure conversion myself. And its already started to demonstrate pay offs! I have moved to the Solr Search engine, which is another emerging implementation of the Lucene Engine. I favour it these days for its added features particularly in Geo Spatial Search capabilities.</p>
<p>Quite simply, my application has a SolrService that takes domain objects that I pass it and convert them to a flattened Solr Object (that I also implemented), that is then passed to the Solr Search Engine through SolrJ. All this is quite simply managed through the afterInsert, afterUpdate and afterDelete triggers in the Domain objects. But it means that I don&#8217;t have to write complex mapping files to try and map my domain structures to the search index I want to create.</p>
<p>What are the benefits? Most of you would state that it would take more time doing this, but I found it to be the contrary. I have spent so much time (sometimes weeks), tweaking searchable configurations and mappings to see how it would affect my index. Looking at indexes with the <a href="http://code.google.com/p/luke/" target="_blank">Luke</a> tool to try and determine what is actually going on and then trying to perform searches against that data to see if I get back what I am after.</p>
<p>I have found that the search indexes are much smaller and much more performant because of it. Because you have much more control over the indexes, I create my indexes so that I don&#8217;t have to do any GORM queries at all when rendering search results. Which you can also do in searchable, but its much more complex to understand the translation.</p>
<p>Soon I will try and post some code on how I actually did this.</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/04/whats-wrong-with-grails-searchable/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Multiple Server Requests from the Browser</title>
		<link>http://robjam.es/2011/04/multiple-server-requests-from-the-browser/</link>
		<comments>http://robjam.es/2011/04/multiple-server-requests-from-the-browser/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 23:18:08 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=402</guid>
		<description><![CDATA[I was recently working on a project and came across this strange occurrence where the browser was quite clearly making more than one request to the server for the same document. At first I thought it was only related to when I would refresh the browser but it soon became apparent that it was for... <a href="http://robjam.es/2011/04/multiple-server-requests-from-the-browser/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was recently working on a project and came across this strange occurrence where the browser was quite clearly making more than one request to the server for the same document. At first I thought it was only related to when I would refresh the browser but it soon became apparent that it was for all requests.</p>
<p>How do you debug something like this? Well, it was a process of elimination, start removing things from the page and see when it starts to occur. Starting with the most typical, I removed js files, then css, and then finally HTML objects when the first 2 didn&#8217;t fix the problem.</p>
<p>Then I found it!</p>
<p>My application has some html rendered in the footer that is used as a template to render some JSON packets that arrive later. These html templates have img tags, but since they are templates the src=&#8221;" is not populated. As soon as I put some content in the src attribute, the double request disappeared!</p>
<p>And sure enough, a quick google brought <a href="http://icanhascode.com/2008/06/the-mystery-of-the-multiple-requests/" target="_blank">this page up</a>.</p>
<p>So my fix was to put a temporary img in there to stop the double requests, of which I overwrite with my JS code when I actually use the template.</p>
<p>BTW: The smart thing to do here would be to use an image that is on every page (like a background image). Remember it is not going to be seen anyway, and it would be much better to use something that doesn&#8217;t require another server request to speed up the page performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/04/multiple-server-requests-from-the-browser/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating HTML with jQuery</title>
		<link>http://robjam.es/2011/04/creating-html-with-jquery/</link>
		<comments>http://robjam.es/2011/04/creating-html-with-jquery/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 00:33:43 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=389</guid>
		<description><![CDATA[Recently I needed to manipulate some HTML for a page where the HTML did not exist in the DOM tree as yet. Or more specifically, I wanted to clone some existing HTML, manipulate it and then re-insert it to the document. Although JQuery has a great .clone(); method, all the examples talk about cloning and... <a href="http://robjam.es/2011/04/creating-html-with-jquery/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to manipulate some HTML for a page where the HTML did not exist in the DOM tree as yet. Or more specifically, I wanted to clone some existing HTML, manipulate it and then re-insert it to the document.</p>
<p>Although JQuery has a great .clone(); method, all the examples talk about cloning and re-inserting without modifying;</p>
<p>ie/ given the follwing HTML,</p>
<p>[code language="html"]<br />
&lt;div class=&quot;group&quot;&gt;<br />
	&lt;div class=&quot;user&quot; id=&quot;1&quot;&gt;User name&lt;/div&gt;<br />
&lt;/div&gt;<br />
[/code]</p>
<p>you can do this;<br />
[code lang="js"]<br />
$('.user').clone().appendTo('.group');<br />
[/code]</p>
<p>But what if you want to do somethnig to your cloned object before re-inserting it into the DOM? Sure, with the above example, this can be quite straight forward, but other scenarios can be a little more complex.</p>
<p>I discovered that the best way to do thia is the following;</p>
<p>[code lang="js"]<br />
var $clone = $('.user').clone()<br />
$clone.attr('id','2')<br />
$clone.html(&quot;Other User&quot;);<br />
$clone.append(&quot;(User Title)&quot;);<br />
$('.group').append($clone);<br />
[/code]</p>
<p>Pretty straight forward, but the main gotcha, is how do you traverse this &#8216;in memory&#8217; DOM tree? For example $clone.$(&#8216;.someClass&#8217;) won&#8217;t work. And this is where the .find() function is your friend!</p>
<p>You can simply do;</p>
<p>[code lang="js"]<br />
$clone.find('.someClass').doSomething();<br />
[/code]</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/04/creating-html-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails for Database Migration</title>
		<link>http://robjam.es/2011/04/grails-for-database-migration/</link>
		<comments>http://robjam.es/2011/04/grails-for-database-migration/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 21:11:30 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[Featured Articles]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=378</guid>
		<description><![CDATA[We recently launched Version 3 of the Posse Platform. With this release, we decided that it was time to look at our domain model. Something we had been avoiding because of the underlying fact that it meant we would need to migrate the database &#8211; a daunting task!!! The approaches we initially looked at included;... <a href="http://robjam.es/2011/04/grails-for-database-migration/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://robjam.es/wp-content/uploads/2011/04/computer_frustration1.jpg"><img alt="" class="alignleft size-medium wp-image-384" src="http://robjam.es/wp-content/uploads/2011/04/computer_frustration1-300x177.jpg" style="margin-left: 20px; margin-right: 20px; float: left; width: 300px; height: 177px; " title="computer_frustration1" /></a></p>
<p>We recently launched Version 3 of the <a href="http://www.posse.com" target="_blank">Posse</a> Platform. With this release, we decided that it was time to look at our domain model. Something we had been avoiding because of the underlying fact that it meant we would need to migrate the database &#8211; a daunting task!!!</p>
<p>The approaches we initially looked at included;</p>
<ol>
<li>using shell scripts to migrate across,</li>
<li>using groovy scripts to do the same,</li>
<li>running groovy scripts inside a grails shell, and even</li>
<li>raw SQL scripts to move from one to the other.</li>
</ol>
<p>Our issues were that we had a domain model that came from Version 1 of the site, which was a PHP application, we then mapped that in &nbsp;Version 2 of the app. Consequently we added new features that used native GORM/Hibernate, and in the end we had a small cacophony of database concepts in a single Database Model!</p>
<p>In the end, I decided to write a new Grails application that would handle the migration. These were the reasons to do so;</p>
<ul>
<li>The new Grails application created new relationships through the new Domain object definitions, the best way to keep the integrity of this was to use native GORM to handle inserts.</li>
<li>I could orchestrate the steps that would need to go into the migrations by using the grails goodness available to me; webflow, controllers, services actions</li>
<li>I could leverage any Helper Services that were written for Version 3 of the application to help with the migration</li>
<li>If need be, there were many plugins that may have helped with things like REST, processing data etc etc</li>
<li>We could do this in a repeatable fashion, we could do a series of trial deployments before doing the real thing.</li>
<li>Its much more fun to write a grails app than it is SQL or Shell Scripts!!!</li>
</ul>
<p>The process required for the migration was quite important, it dictated what steps had to happen at what point, and how to best approach it. I also made the conscious decision to work across a snapshot of the production database rather that the actual prod DB, as it was quicker (We are deployed in the cloud, and part of the migration was to move across regions). Therefore, I took a snapshot of the production database and a new database was created before being moved to the new production environment. These are the steps that I undertook;</p>
<ol>
<li>Take a snapshot of prod to the migration application (pretty self explanatory)</li>
<li>Run some cleanup scripts : we identified some dirty data in our application, so we had a data cleanup party <img src='http://robjam.es/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  Essentially we got everyone together and got humans to determine what was a duplicate, what should be deleted, or general data cleanup (typos etc). We then used this data to cleanup the actual database</li>
<li>Next step was to migrate the tables that we could bring across verbatim. One of the constraints in the migration was that we wanted to be able to bring some of the key data across that we used in our application and retain the primary Keys. Unfortunately, GORM does not provide an easy way to do this. So I essentially wrote a series of GSQL scripts that moved tables across, keeping any information that we needed to keep, but we also had the luxury to use services in our application that help convert data. One example of this was moving currency information from a DB domain object to an Enum Class. And a Helper service did the heavy lifting of converting the data.</li>
<li>Now that most of the main data was brought across from Version 2 database to Version 3, we could use our GORM objects to create any missing information, such as relationships, cleaning up constraints or general conversion of any Version 2 data to Version 3.</li>
<li>The final step was to clean anything up that remained to be done &#8211; usually deleting data, or running any final scripts. And then migrate the newly created database to the production instance.</li>
</ol>
<p>The magic here was in a couple of elements. Firstly, GSQL is your friend. It allowed scripts to be written to bring raw data out, which can then be created using GORM objects in the new application. Secondly was the conscious architectural decision to take any of the back end of our application (Domains and Services) and move them into a plugin. This was actually decided for altogether different reasons (as we had a couple of applications that needed to share the domain model), but it helped here as we could simply include the same domain model plugin, and the migration application would create the exact database that the production website wanted to see. Woila!!!</p>
<p>I initially thought that creating a grails app would be overkill for a task like this, but in hindsight, it was more of a psychological constraint thinking you are writing a whole new app to perform this function. Creating a new application is as simple as typical &quot;grails create-app migration&quot; <img src='http://robjam.es/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>This is definitely a great approach to database migration that takes you out of the slurry of writing raw scripts, I would do it again!</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/04/grails-for-database-migration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Reader and Feed.ly tip</title>
		<link>http://robjam.es/2011/03/google-reader-and-feed-ly-tip/</link>
		<comments>http://robjam.es/2011/03/google-reader-and-feed-ly-tip/#comments</comments>
		<pubDate>Thu, 10 Mar 2011 10:17:33 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[General News]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=374</guid>
		<description><![CDATA[I&#39;m a huge fan of the feedly reader in my browser. But there is something that has been driving me crazy. I constantly get unread messages that are entirely unrelated to my subscriptions, and I&#39;m a bit of a stickler for making sure my inbox is cleared &#8211; including my RSS feeds, and I am... <a href="http://robjam.es/2011/03/google-reader-and-feed-ly-tip/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#39;m a huge fan of the feedly reader in my browser. But there is something that has been driving me crazy. I constantly get unread messages that are entirely unrelated to my subscriptions, and I&#39;m a bit of a stickler for making sure my inbox is cleared &#8211; including my RSS feeds, and I am very specific to what I subscribe to.</p>
<p>Google Reader (and consequently Feed.ly through its support), have the Social Capabilities built into the app, which is all about showing relevant posts from people in your social network and buzz posts. But not clear way to turn this off!!</p>
<p>I finally found out how and its quite easy!</p>
<ol>
<li>Log into your Google Reader account and go to the reader main page</li>
<li>type the following into the URL bar and hit enter:&nbsp;javascript:antisocial(&#39;true&#39;)</li>
<li>That&#39;s it!!!</li>
</ol>
<p>You will no longer get posts from Buzz or feeds that you haven&#39;t subscribed to!</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/03/google-reader-and-feed-ly-tip/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting a Session Timeout in your Grails Application</title>
		<link>http://robjam.es/2011/03/setting-a-session-timeout-in-your-grails-application/</link>
		<comments>http://robjam.es/2011/03/setting-a-session-timeout-in-your-grails-application/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 00:52:13 +0000</pubDate>
		<dc:creator>Rob James</dc:creator>
				<category><![CDATA[General News]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://robjam.es/?p=371</guid>
		<description><![CDATA[Sometimes you need to change the Session Timeout in your grails application. But the important thing to know is that its not really an attribute your application supports, but its something that you can tell your container to change. To do this, you need access to your web.xml file, which is not available by default.... <a href="http://robjam.es/2011/03/setting-a-session-timeout-in-your-grails-application/"  class="read_more">Read More <span class='readmore_arrow'>&#62;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to change the Session Timeout in your grails application. But the important thing to know is that its not really an attribute your application supports, but its something that you can tell your container to change.</p>
<p>To do this, you need access to your web.xml file, which is not available by default. First run;</p>
<p><meta charset="utf-8" /></p>
<blockquote>
<p>grails install-templates</p>
</blockquote>
<p>Then you need to&nbsp;edit &quot;src/templates/war/web.xml&quot; and add or change after servlet-mapping;</p>
<p>&nbsp;</p>
<blockquote>
<div>&lt;session-config&gt;</div>
<div>&nbsp;&nbsp; &lt;session-timeout&gt;60&lt;/session-timeout&gt;</div>
<div>&lt;/session-config&gt;</div>
</blockquote>
<p>The value that you pass in the session-timeout is in minutes. And you&#39;re done!</p>
]]></content:encoded>
			<wfw:commentRss>http://robjam.es/2011/03/setting-a-session-timeout-in-your-grails-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

