<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Tomás Lin's Programming Brain Dump</title>
	<atom:link href="http://fbflex.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://fbflex.wordpress.com</link>
	<description>Flex, Grails, Facebook, iPhone and all that Jazz</description>
	<lastBuildDate>Sun, 29 Jan 2012 10:25:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='fbflex.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Tomás Lin's Programming Brain Dump</title>
		<link>http://fbflex.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://fbflex.wordpress.com/osd.xml" title="Tomás Lin&#039;s Programming Brain Dump" />
	<atom:link rel='hub' href='http://fbflex.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Deploying Grails applications on AppFog. First impressions.</title>
		<link>http://fbflex.wordpress.com/2012/01/27/deploying-grails-applications-on-appfog-first-impressions/</link>
		<comments>http://fbflex.wordpress.com/2012/01/27/deploying-grails-applications-on-appfog-first-impressions/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 01:08:48 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1195</guid>
		<description><![CDATA[I had a chance to play a little bit with AppFog today. Appfog is a version of VMware&#8217;s Cloud Foundry hosted by the makers of PHPFog that aims to overcome some of the limitations of the VMware product. It&#8217;s very &#8230; <a href="http://fbflex.wordpress.com/2012/01/27/deploying-grails-applications-on-appfog-first-impressions/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1195&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a chance to play a little bit with <a href="http://www.appfog.com/">AppFog</a> today. Appfog is a version of VMware&#8217;s Cloud Foundry hosted by the makers of PHPFog that aims to overcome some of the limitations of the VMware product. It&#8217;s very nice.</p>
<p>In their announcement <a href="http://blog.phpfog.com/2011/08/25/appfog-reveals-cloud-foundry-integration-for-multi-language-support/?utm_source=AppFog+Private+Beta+-+Group+13&amp;utm_campaign=6c87344ecb-AppFog_Private_Beta_12_09_2011&amp;utm_medium=email">blog post</a>, AppFog stated: &#8220;Cloud Foundry alone has no web interface, no pricing, no plans, no IaaS integration (no AWS, no S3), no support. That is where AppFog shines.&#8221;</p>
<p>True to their word, AppFog provides deployment to 4 different providers and offers 64 gigs of memory for a monthly rate of $29.99 (Gringo Dollars).</p>
<p>In this post, I&#8217;ll walk briefly over my first impressions deploying a Grails application on AppFog. Overall, it is a much richer and pleasant experience than Cloud Foundry and looks like we finally have a competitor to Heroku or Cloudbees. <span id="more-1195"></span></p>
<p><strong>Deployment</strong></p>
<p>Since appfog has the same underlying structure as CloudFoundry, deploying a new application to it was the same as the traditional <a href="http://blog.springsource.org/2011/04/12/one-step-deployment-with-grails-and-cloud-foundry/">Cloud Foundry plugin</a>.</p>
<p>One consideration is that you needed to specify the deployment target.</p>
<p>In grails-app/conf/Config.groovy, add the following lines</p>
<p><pre class="brush: plain;">

grails.plugin.cloudfoundry.username = &quot;email@example.com&quot;
grails.plugin.cloudfoundry.password = &quot;mypassword&quot;
grails.plugin.cloudfoundry.target = &quot;http://api.aws.af.cm&quot;

</pre></p>
<p>After building your application, you simply deploy it like a typical cloudfoundry application</p>
<p><pre class="brush: plain;">

grails prod cf-push

</pre></p>
<p>After deployment, you should see your application deployed correctly. Mine can be found at <a href="http://grails.aws.af.cm/">http://grails.aws.af.cm</a></p>
<p><strong>Targets &#8211; Deploying to stuff besides VMware iron.</strong></p>
<p>AppFog offers 4 different type of targets aside from the one offered by VMware:</p>
<ul>
<li>api.aws.af.cm &#8211; <a href="http://appfog.com/">AppFog&#8217;s</a> Amazon-based service</li>
<li>api.rackspace.af.cm &#8211; <a href="http://appfog.com/">AppFog&#8217;s</a> Rackspace-based service</li>
<li>api.hp.af.cm &#8211; <a href="http://appfog.com/">AppFog&#8217;s</a> HP Cloud-based service</li>
<li>api.joyent.af.cm &#8211; <a href="http://appfog.com/">AppFog&#8217;s</a> Joyent-based service</li>
</ul>
<p>However, it doesn&#8217;t seem that you are able to have further control over this, so it wasn&#8217;t very clear that you could specify that you wanted your Amazon servers to be based in Ireland, for example.</p>
<p><strong>Services</strong></p>
<p>Appfog offers support for MongoDB and MySQL.</p>
<p>By default, the cloud foundry plugin will ask if you want to provision a service for MySQL and Postgres. Selecting that you wanted to deploy a Postgres service broke the deploy script by returning a null.</p>
<p>Tunneling support to access services on AppFog is <a href="http://blog.appfog.com/manage-your-appfog-data-from-your-workstation/">provided</a>.</p>
<p><strong>Admin UI</strong></p>
<p>What makes AppFog really exciting compared to the VMware solution is the Admin UI that they offer for your application.</p>
<p><a href="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-29-16.png"><img class="aligncenter size-full wp-image-1196" title="Login Page" src="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-29-16.png?w=640&#038;h=385" alt="" width="640" height="385" /></a>Your application appears on screen after you have logged in,</p>
<p><a href="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-48-35-1.png"><img class="aligncenter size-full wp-image-1203" title="Screen Shot 2012-01-28 at 00.48.35 1" src="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-48-35-1.png?w=640&#038;h=185" alt="" width="640" height="185" /></a>you can also view the services you have provisioned.</p>
<p><a href="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-30-05.png"><img class="aligncenter size-full wp-image-1201" title="Screen Shot 2012-01-28 at 00.30.05" src="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-30-05.png?w=640&#038;h=399" alt="" width="640" height="399" /></a>Clicking on your application takes you to a quick admin console.</p>
<p>Taking a page out of Heroku, you can quickly configure the number of instances of your application you want to run at the time. I was able to quickly and easily add another instance of my grails application with little hassle.</p>
<p><a href="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-50-55.png"><img class="aligncenter size-full wp-image-1204" title="Screen Shot 2012-01-28 at 00.50.55" src="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-50-55.png?w=640&#038;h=379" alt="" width="640" height="379" /></a>Appfog also provides the ability to map custom domains, something that CloudFoundry has <a href="http://support.cloudfoundry.com/entries/20023186-dns-support">promised for over 10 months</a> and has done nothing about.</p>
<p><a href="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-30-45.png"><img class="aligncenter size-full wp-image-1200" title="Screen Shot 2012-01-28 at 00.30.45" src="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-30-45.png?w=640&#038;h=400" alt="" width="640" height="400" /></a></p>
<p>You can also easily modify your application settings and see the statistics. Overall, it is very nicely done for a preview version:</p>
<p><a href="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-52-35.png"><img class="aligncenter size-full wp-image-1205" title="Screen Shot 2012-01-28 at 00.52.35" src="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-52-35.png?w=640&#038;h=376" alt="" width="640" height="376" /></a><br />
One of the niceties of Appfog is that you can create a github or dropbox based repo and it will automatically build this and deploy it for you. Unfortunately, this is not available for Java or Grails.</p>
<p><a href="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-29-45.png"><img title="Screen Shot 2012-01-28 at 00.29.45" src="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-29-45.png?w=640&#038;h=382" alt="" width="640" height="382" /></a></p>
<p><strong>Pricing</strong></p>
<p>Another element missing from Cloud Foundry since it&#8217;s introduction is pricing. Appfog seems to suggest that for $29 / month, you are able to get 64 gigs of memory. This might just be a placeholder value, but it&#8217;s nice to see that at least they are trying to attach a figure to hosting on their services.<a href="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-57-23.png"><img class="aligncenter size-full wp-image-1206" title="Screen Shot 2012-01-28 at 00.57.23" src="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-57-23.png?w=640&#038;h=249" alt="" width="640" height="249" /></a></p>
<p><strong>Summary</strong></p>
<p>Overall, I was very impressed with the AppFog Beta. It seem compatible with the grails plugin for Cloud Foundry and deployment seems to be fairly painless.</p>
<p>The lack of Grails / Java github support is disappointing. I would still probably use Heroku or Cloudbees for a git-based continous deployment approach.</p>
<p>As a long time Cloud Foundry user, it feels like a lot of holes in the VMware offering are plugged by Appfog. It is quite refreshing to see a company taking the Cloud Foundry project into the commercial sphere instead of just being an academic exercise. Appfog is what Cloud Foundry should have been when it launched.</p>
<p>You can request early beta access for appfog on their site <a href="http://www.appfog.com/">here</a>.</p>
<p>However, there seems to be quite a wait for this, as I remember requesting access when the service was first announced back in August.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1195&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2012/01/27/deploying-grails-applications-on-appfog-first-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>

		<media:content url="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-29-16.png" medium="image">
			<media:title type="html">Login Page</media:title>
		</media:content>

		<media:content url="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-48-35-1.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-28 at 00.48.35 1</media:title>
		</media:content>

		<media:content url="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-30-05.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-28 at 00.30.05</media:title>
		</media:content>

		<media:content url="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-50-55.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-28 at 00.50.55</media:title>
		</media:content>

		<media:content url="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-30-45.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-28 at 00.30.45</media:title>
		</media:content>

		<media:content url="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-52-35.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-28 at 00.52.35</media:title>
		</media:content>

		<media:content url="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-29-45.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-28 at 00.29.45</media:title>
		</media:content>

		<media:content url="http://fbflex.files.wordpress.com/2012/01/screen-shot-2012-01-28-at-00-57-23.png" medium="image">
			<media:title type="html">Screen Shot 2012-01-28 at 00.57.23</media:title>
		</media:content>
	</item>
		<item>
		<title>Running Geb specs using a separate driver profile to test mobile views in Grails</title>
		<link>http://fbflex.wordpress.com/2012/01/18/running-geb-specs-using-a-separate-driver-profile-to-test-mobile-views-in-grails/</link>
		<comments>http://fbflex.wordpress.com/2012/01/18/running-geb-specs-using-a-separate-driver-profile-to-test-mobile-views-in-grails/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 14:28:04 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1175</guid>
		<description><![CDATA[We&#8217;re currently building mobile views for our grails application using jQuery mobile and the Spring mobile plugin. As such, we wanted to add a set of mobile tests in Geb to run in parallel with our application&#8217;s functional tests. In &#8230; <a href="http://fbflex.wordpress.com/2012/01/18/running-geb-specs-using-a-separate-driver-profile-to-test-mobile-views-in-grails/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1175&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re currently building mobile views for our grails application using jQuery mobile and the Spring mobile plugin. As such, we wanted to add a set of mobile tests in Geb to run in parallel with our application&#8217;s functional tests.</p>
<p>In this post, I show how you can set up a separate webdriver profile for a subset of your spock/geb functional tests. <span id="more-1175"></span></p>
<p>In order to specify a separate driver profile ( we&#8217;re setting an iPhone user agent in our tests ), we needed a way to mark the new tests we&#8217;re creating to use this separate profile.</p>
<p><a href="https://twitter.com/#!/marcinerdmann">Marcin Erdman</a> suggested in the<a href="http://markmail.org/message/qiainbyebjuhisie"> Geb mailing list</a> that it is possible to use the Geb Configuration mechanism to accomplish this, but you would end up creating a new driver for each test, which we wanted to avoid.</p>
<p>After a little bit of tweaking, we came up with the following base class for our tests to extend.</p>
<p><pre class="brush: groovy;">

import geb.spock.GebSpec
import spock.lang.Shared
import org.openqa.selenium.firefox.FirefoxProfile
import org.openqa.selenium.firefox.FirefoxDriver

class MobileSpeck extends GebSpec {

@Shared def cachedDriver

def setupSpec(){
  // create a new firefox profile with an iPhone user agent and cache it

  FirefoxProfile profile = new FirefoxProfile();
  profile.setPreference(&quot;general.useragent.override&quot;, 'Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_0 like Mac OS X; en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0 Mobile/7A341 Safari/528.1');
  cachedDriver = new FirefoxDriver( profile )
}

def setup(){
  // assign this as the default driver on the browser for each test
  browser.driver = cachedDriver
}

def cleanupSpec(){
  // after running the spec, kill the driver
  cachedDriver.quit()
}

}

</pre></p>
<p>( Note, this code is for 1.3.7, you might need to change GebSpec to use Specification if you are using grails 2.0. )</p>
<p>Basically, we create a new firefox driver with the desired profile and cache it in memory.</p>
<p>When a new spec is ran extending this speck ( we use the base class speck so that spock won&#8217;t try to run it as a test ), it will be assigned the new cachedDriver and use it instead of the default Geb driver.</p>
<p>After adding this Speck, we are able to specify a test by just extending the class. I.e,</p>
<p><pre class="brush: groovy;">

class iPhoneUserLoginSpec extends MobileSpeck {

...

}

</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1175&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2012/01/18/running-geb-specs-using-a-separate-driver-profile-to-test-mobile-views-in-grails/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
		<item>
		<title>Slides from &#8216;A year in the life of a Grails startup&#8217;</title>
		<link>http://fbflex.wordpress.com/2011/12/10/slides-from-a-year-in-the-life-of-a-grails-startup/</link>
		<comments>http://fbflex.wordpress.com/2011/12/10/slides-from-a-year-in-the-life-of-a-grails-startup/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 23:25:38 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1178</guid>
		<description><![CDATA[Here is a copy of our slides from the Grails Exchange. You can watch our talk here. You can view the entire talk here.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1178&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is a copy of our slides from the Grails Exchange. You can watch our talk here.</p>
<iframe src='http://www.slideshare.net/slideshow/embed_code/10545925' width='640' height='525'></iframe>
<p>You can view the entire talk <a href="http://skillsmatter.com/podcast/groovy-grails/grails-as-mobile-backend">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1178/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1178/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1178/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1178&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2011/12/10/slides-from-a-year-in-the-life-of-a-grails-startup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
		<item>
		<title>Suggestions to keeping Grails one step ahead &#8211; a wishlist</title>
		<link>http://fbflex.wordpress.com/2011/12/10/suggestions-to-keeping-grails-one-step-ahead-a-wishlist/</link>
		<comments>http://fbflex.wordpress.com/2011/12/10/suggestions-to-keeping-grails-one-step-ahead-a-wishlist/#comments</comments>
		<pubDate>Sat, 10 Dec 2011 22:46:50 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1168</guid>
		<description><![CDATA[At the Grails Exchange, Marc Palmer gave an excellent talk about keeping Grails one step ahead. This talk resonated a bit with the work we been doing in Secret Escapes for the last few months. After having a little think &#8230; <a href="http://fbflex.wordpress.com/2011/12/10/suggestions-to-keeping-grails-one-step-ahead-a-wishlist/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1168&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>At the Grails Exchange, Marc Palmer gave an excellent talk about <a href="http://skillsmatter.com/podcast/groovy-grails/keeping-grails-one-step-ahead">keeping Grails one step ahead</a>. This talk resonated a bit with the work we been doing in Secret Escapes for the last few months.</p>
<p>After having a little think about it, I feel like there are a few other things that would be nice to have to make Grails a easier choice for developers:</p>
<p><span id="more-1168"></span></p>
<p><strong>1. A Payment / Transaction / Shipping API ( E-commerce plugins ) -</strong> Right now, it is fairly difficult to add a Payment Gateway or Merchant Account. Tools like Magento in the PHP world do a fantastic job in abstracting away the details of integrating a payment gateway and merchant account. It would be nice to have a common API extended by all the different payment plugins. This would make it easier to build ecommerce functionality without having to worry about whether you are using BrainTree, Authorize.net or Satan&#8217;s favorite Payment Gateway, Paypal.</p>
<p><strong>2. Internationalization API &#8211; </strong>At the exchange, I mentioned that Globalizing a Grails application is still a bit complicated. There seems to be a few plugins that set out to help localize domains and message bundles, but what seems to be lacking is a plugin like resources where you can go &#8211; &#8220;oh, I need to support multiple languages, I need to install the Globalize plugin&#8221;.</p>
<p>Message bundles simply do not go far enough in this respect. There still doesn&#8217;t seem to be a straightforward way to add multiple language enabled domain classes, url mappings or do ad-hoc language switching very easily. This problem was very apparent 4 years ago when I was building sites in Canada, and it is still true today.  <strong><br />
</strong></p>
<p><strong>3. Easier to customize scaffolding &#8211; </strong>The CRUD interfaces provided by Grails scaffolding are getting very nice. But it would be nicer if the scaffolding framework could be more extensible. If you look at the code of plugins like Flex Scaffold, there seems to be a lot of work being done for it to be similar to the default html scaffolding.</p>
<p>It would be nice if there was a common scaffolding interface that enabled adding rich client or mobile templates. It would also be nice if it was possible to add more template types, so instead of the typical &#8216;You can edit only one item at the time in separate screens&#8217;, scaffolding supported things like adding master-detail views, search and reporting templates and other types of alternative views that are automatically generated.</p>
<p><strong>4. A/B Testing Framework -</strong> Working with frameworks like Google Website optimizer, it is pretty clear that a native grails A/B testing framework like <a href="http://www.bingocardcreator.com/abingo">ABingo</a> or <a href="http://vanity.labnotes.org/rails.html">Vanity</a>.</p>
<p><strong>5. Member Services / Identity API &#8211; </strong>Working on a member&#8217;s only site for the last year has highlighted the need for a higher level framework for managing users. Nimble, Spring Security UI all provide a pretty good approach. But it would be nice if there was a common extensible core for this type of functionality.</p>
<p><strong>6. Easier Reporting -</strong> on the business needs end of things, it would be nice if there was a slightly higher level page view tracking and reporting mechanism enabled. In our talk, we talked about how we built a simple engine that enabled us to store SQL / Groovy queries and render this out into reports. It would be nice to be able to easily generate summary reports and charts on domain classes, pageviews and similar mechanisms.</p>
<p><strong>7. Content API / SEO -</strong> There doesn&#8217;t seem to be a lot of information about how to make Grails sites very SEO friendly. It would be nice if the URLMapping and Layout mechanism enabled easier customization of domain objects to inject specific fields like title, keywords and descriptions to domain objects. Also, having the ability to have sitemaps automatically provided and robots.txt templates provided would be very helpful.</p>
<p>Can you think of anything else?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1168/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1168/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1168/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1168&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2011/12/10/suggestions-to-keeping-grails-one-step-ahead-a-wishlist/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
		<item>
		<title>A Script to run Grails Functional Tests in Parallel</title>
		<link>http://fbflex.wordpress.com/2011/12/01/a-script-to-run-grails-functional-tests-in-parallel/</link>
		<comments>http://fbflex.wordpress.com/2011/12/01/a-script-to-run-grails-functional-tests-in-parallel/#comments</comments>
		<pubDate>Thu, 01 Dec 2011 20:39:22 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1165</guid>
		<description><![CDATA[The following post is about our effort to set up a way to run functional tests in Parallel for our grails application. It contains a script that will run functional tests based on X-number of instances of the application server, &#8230; <a href="http://fbflex.wordpress.com/2011/12/01/a-script-to-run-grails-functional-tests-in-parallel/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1165&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The following post is about our effort to set up a way to run functional tests in Parallel for our grails application. It contains a script that will run functional tests based on X-number of instances of the application server, creating the right databases and the proper environment.</p>
<p><span id="more-1165"></span></p>
<h2>The problem</h2>
<p>At <a href="http://www.secretescapes.com">Secret Escapes</a>, we have been struggling with the amount of time it takes to run functional tests. Our tests written in <a href="http://www.gebish.org">Geb</a> and <a href="http://code.google.com/p/spock/">Spock</a> has grown substantially and it takes up to 25 minutes to run completely.</p>
<p>During Luke Daley&#8217;s <a href="http://skillsmatter.com/podcast/groovy-grails/luke-daley-qa">talk at the GGUG in London</a>, he mentioned that one solution to speed up running functional tests was to set up multiple environments and run functional tests against each of them.</p>
<p>We wanted a way to do this in developer machines so they could run in parallel. After a few days of head scratching and &#8216;WTF doesn&#8217;t this work!&#8217;, we ( Donovan Frew, Michael Stogowski and me) came up with the script below.</p>
<h2>The Script</h2>
<p>Save this script in your scripts directory. The name we use for it is TestFunc.groovy</p>
<p><pre class="brush: groovy;">
import groovy.sql.*
import org.codehaus.groovy.grails.test.*
import org.codehaus.groovy.grails.test.support.*
import org.codehaus.groovy.grails.test.event.*

includeTargets &lt;&lt; grailsScript(&quot;TestApp&quot;)

target(main: &quot;Runs functional tests in parallel in sets of bucketSize&quot;) {
	def reportsDir = 'reports'
	def numberOfServers = 5

	def sql = Sql.newInstance('jdbc:mysql://localhost:3306/', 'root', '', 'com.mysql.jdbc.Driver')

	def tests = new SpecFinder(binding).getTestClassNames()
	new File(reportsDir).mkdirs()
	def commands = []
	def threads = []
	def results = ''

	numberOfServers.times { id -&gt;

		def reportsFile = new File(reportsDir + '/' + 'test' + id).absolutePath

		sql.execute( &quot;DROP DATABASE IF EXISTS parallelDB${id};&quot; )
		sql.execute( &quot;CREATE DATABASE parallelDB${id};&quot; )

		def pattern = ''

		tests.eachWithIndex { test, index -&gt;

			if (index % numberOfServers == id)
			{
				pattern += &quot; ${ tests.get(index) }&quot;
			}

		}

		def command = &quot;grails -Dgrails.project.test.reports.dir=${reportsFile} -Dserver.port=909${id} -Ddb.name=parallelDB${id} test-app functional:  ${pattern}&quot;

		threads &lt;&lt; Thread.start {

			println command
			ProcessBuilder builder = new ProcessBuilder(command.split(' '));

			builder.redirectErrorStream(true);
			Process process = builder.start();

			InputStream stdout = process.getInputStream();
			BufferedReader reader = new BufferedReader(new InputStreamReader(stdout));

			while ((line = reader.readLine()) != null)
			{
				if( !line.contains( 'buildtestdata.DomainInstanceBuilder' ) ){
					System.out.println(&quot;Server ${id}: &quot; + line);
				}

				if( line.contains( 'Tests passed:' ) || line.contains( 'Tests failed:' ) ){
					results += &quot;Server ${id}: &quot; + line + '\n'
				}
			}

		}

	}

	threads.each {
		it.join()
	}

	println '------------------------------------'
	println 'Tests FINISHED'
	println '------------------------------------'
	println results

}

setDefaultTarget(main)

class SpecFinder extends GrailsTestTypeSupport {

	SpecFinder(binding) {
		super('name', 'functional')
		buildBinding = binding
	}

	int doPrepare() {
		0
	}

	GrailsTestTypeResult doRun(GrailsTestEventPublisher eventPublisher) {
		null
	}

	def getTestClassNames() {
		findSourceFiles(new GrailsTestTargetPattern('**.*Spec')).sort{ -it.length() }.collect{ sourceFileToClassName(it) }
	}
}

</pre></p>
<h2>How it works:</h2>
<p>This script only works with Geb Specs. If you need to use some other sort of functional testing, you will have to modify the way you identify your tests.</p>
<p>In order to have parallel environments, we needed to set up:</p>
<ol>
<li>Different Databases</li>
<li>Different Report Directories so they wouldn&#8217;t get overwritten by each other</li>
<li>Different Ports to run functional tests against.</li>
</ol>
<h2>Notes about the script</h2>
<ul>
<li>We use the ProcessBuilder instead of the standard Groovy .execute() method so we can bind the output of the script straight to the console while the script is running.</li>
<li>Funtional specs are sorted by file size and executed via pattern matching. It could be more sophisticated but seems to work.</li>
</ul>
<h2>Application Changes needed for the Test environment</h2>
<ul>
<li>To get this to work, we needed to change places in our Config.groovy that had a hard-coded reference to 8080. Instead, we specified a port name like so:<pre class="brush: plain;">grails.serverURL = &quot;http://localhost:${ System.getProperty(&quot;server.port&quot;)?:'8080' }/${appName}&quot;</pre></li>
<li>You also need to change the way your test environment loads it&#8217;s datasource so it can be overwritten by the command line. We changed ours to<pre class="brush: plain;">
def dbName = System.getProperty(&quot;db.name&quot;) ?: 'flashsales_test'
url = &quot;jdbc:mysql://localhost:3306/$dbName?autoReconnect=true&quot;
</pre></li>
<li>This way, whenever db.name was specified in the command line, the test Datasource would use this.</li>
<li>Change our functional tests so that there are no hard references to port 8080.</li>
<li>We use mysql and the groovy sql mechanism to create new databases for these environments. You might choose a different poison.</li>
</ul>
<h2>Running the Script</h2>
<ul>
<li>You can change the number of instance you want to run by changing the numberOfServers value. A quick modification to the script would be to make this value one that the script gets, but we haven&#8217;t gotten there yet.</li>
<li>To run, just type grails test-func in your console.</li>
</ul>
<h2>Results</h2>
<p>After getting this to work correctly, we noticed that in some cases, our test execution time went down from 26 minutes to 12 minutes. It is a definitive improvement.</p>
<h2>Things to Do Next</h2>
<ul>
<li>We would like to use the Grails pattern matching for test-app here, but haven&#8217;t had a chance to dig deeply into the code to do so.</li>
<li>Number of servers, database names should all be configurable or read from Config.groovy.</li>
<li>Not sure if running something like GPars would give us a performance gain over running scripts again.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1165/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1165&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2011/12/01/a-script-to-run-grails-functional-tests-in-parallel/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
		<item>
		<title>Replacing the Groovy execute() method with one that prints output while the process is running</title>
		<link>http://fbflex.wordpress.com/2011/11/30/replacing-the-groovy-execute-method-with-one-that-prints-output-while-the-process-is-running/</link>
		<comments>http://fbflex.wordpress.com/2011/11/30/replacing-the-groovy-execute-method-with-one-that-prints-output-while-the-process-is-running/#comments</comments>
		<pubDate>Wed, 30 Nov 2011 17:40:24 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1163</guid>
		<description><![CDATA[We are writing a small script to help us run our grails functional tests in parallel. One of the issues we are running into with Groovy&#8217;s execute() method and its online examples is that the output from the process is &#8230; <a href="http://fbflex.wordpress.com/2011/11/30/replacing-the-groovy-execute-method-with-one-that-prints-output-while-the-process-is-running/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1163&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We are writing a small script to help us run our grails functional tests in parallel.</p>
<p>One of the issues we are running into with Groovy&#8217;s execute() method and its <a href="http://groovy.codehaus.org/Process+Management">online examples</a> is that the output from the process is not available until the process is finished.</p>
<p>When running Grails functional tests, we want to see the results right away in the console to debug things that are going wrong.</p>
<p>The solution we found was to use the Java ProcessBuilder task instead.</p>
<p>So instead of</p>
<p><pre class="brush: groovy;">myCommand.execute()</pre></p>
<p>in Groovy, use the following wall of code:</p>
<p><pre class="brush: groovy;">

ProcessBuilder builder = new ProcessBuilder( myCommand.split(' ') )

builder.redirectErrorStream(true)

Process process = builder.start()

InputStream stdout = process.getInputStream ()
BufferedReader reader = new BufferedReader (new InputStreamReader(stdout))

while ((line = reader.readLine ()) != null) {
   System.out.println (&quot;Stdout: &quot; + line)
}

</pre></p>
<p>You could probably change this so that it replaces the groovy metaclass methods, but it&#8217;s a start. </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1163/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1163/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1163/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1163&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2011/11/30/replacing-the-groovy-execute-method-with-one-that-prints-output-while-the-process-is-running/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
		<item>
		<title>Grails quick tip: Testing Spock Interactions wrapped by the Executor plugin</title>
		<link>http://fbflex.wordpress.com/2011/10/26/grails-quick-tip-testing-spock-interactions-wrapped-by-the-executor-plugin/</link>
		<comments>http://fbflex.wordpress.com/2011/10/26/grails-quick-tip-testing-spock-interactions-wrapped-by-the-executor-plugin/#comments</comments>
		<pubDate>Wed, 26 Oct 2011 21:57:52 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1153</guid>
		<description><![CDATA[We ran into an interesting issue today working with Spock, Grails and the executor plugin. The executor plugin allows you to move tasks that might be long running into the background of your application. In this post, I will show &#8230; <a href="http://fbflex.wordpress.com/2011/10/26/grails-quick-tip-testing-spock-interactions-wrapped-by-the-executor-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1153&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>We ran into an interesting issue today working with Spock, Grails and the executor plugin.</p>
<p>The <a href="http://www.grails.org/plugin/executor">executor</a> plugin allows you to move tasks that might be long running into the background of your application. </p>
<p>In this post, I will show you how to unit test spock interactions wrapped inside the runAsync methods provided by the plugin.<br />
<span id="more-1153"></span></p>
<p>A typical block of code within executor would look like this:</p>
<p><code><br />
myServiceMethod() {<br />
     ... non Async code ...<br />
     runAsync{<br />
        someOtherService.asyncMethod( var1 )<br />
     }<br />
  }<br />
</code></p>
<p>We ran into a peculiar problem while moving our code into the executor plugin today.</p>
<p>We normally mock <a href="http://code.google.com/p/spock/wiki/Interactions">interactions</a> in spock within our unit tests to make sure that certain methods are called.</p>
<p>our tests run something like this:</p>
<p><code><br />
when:<br />
   service.serviceMethod()<br />
then:<br />
   1 * someOtherService.asyncMethod( _ )<br />
</code></p>
<p>This works fine when you have no code within the runAsync block, but if you move code into the runAsync closure, the method call don&#8217;t get detected by Spock anymore. </p>
<p>It meant that moving our code to make it asynchronous also broke our unit specs. All our interactions would seem to disappear as they were now being ran in another thread.</p>
<p>The way we were able to solve this problem is to just rewrite the runAsync method in the service metaclass within our tests, so we added:</p>
<p><code><br />
<em>given:<br />
   service.metaClass.runAsync = { it() }<br />
</em>when:<br />
   service.serviceMethod()<br />
then:<br />
   1 * someOtherService.asyncMethod( _ )<br />
</code></p>
<p>The first line basically says &#8216;take the code within the runAsync closure, and just execute it&#8217;.</p>
<p>After adding this, all our unit specs pass again.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1153/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1153/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1153/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1153&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2011/10/26/grails-quick-tip-testing-spock-interactions-wrapped-by-the-executor-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
		<item>
		<title>Six ways to become a better Grails programmer</title>
		<link>http://fbflex.wordpress.com/2011/10/24/six-ways-to-become-a-better-grails-programmer/</link>
		<comments>http://fbflex.wordpress.com/2011/10/24/six-ways-to-become-a-better-grails-programmer/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 22:41:54 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1129</guid>
		<description><![CDATA[1. Read the Groovy books Groovy is the heart of Grails, but it is surprising how easy it is to get by writing code the Java way. I think it was four months after I started writing code in Grails &#8230; <a href="http://fbflex.wordpress.com/2011/10/24/six-ways-to-become-a-better-grails-programmer/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1129&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>1. Read the Groovy books</strong></p>
<p>Groovy is the heart of Grails, but it is surprising how easy it is to get by writing code the Java way.</p>
<p>I think it was four months after I started writing code in Grails that I started looking at the Groovy books, and they definitively helped me improve the code I was writing tremendously.</p>
<ul>
<li><a href="http://www.amazon.co.uk/gp/product/1934356093/ref=as_li_ss_tl?ie=UTF8&amp;tag=httpfbflexwor-21&amp;linkCode=as2&amp;camp=1634&amp;creative=19450&amp;creativeASIN=1934356093">Venkat Subramaniam&#8217;s Programming Groovy</a> &#8211; Good chapters on metaprogramming.</li>
<li><a href="http://www.manning.com/koenig2/">Dierk Koenig&#8217;s Groovy In Action, 2nd Edition, MEAP</a> &#8211; Excellent for understanding newer concepts like AST transformations.</li>
</ul>
<p><span id="more-1129"></span></p>
<p><strong>2. Consume videos, podcasts and blogs</strong></p>
<p>There is no lack of new content being published on the web about Grails and Groovy. The following are my favorite resources:</p>
<ul>
<li>Burt Beckwith publishes a weekly summary of the things going on in the Grails ecosystem in <a href="http://burtbeckwith.com/blog/">This Week In Grails</a>.</li>
<li><a href="http://grailspodcast.com/blog/list">The Grails Podcast</a>, <a href="http://groovymag.com/">GoovyMag</a> and <a href="http://www.groovytweets.org/">Groovy Tweets</a> are really good ways to keep track of new ideas in the Grails ecosystem.</li>
<li><a href="http://mrhaki.blogspot.com/">Messages from Mr. Haki</a> and <a href="http://blog.springsource.com/author/peter-ledbrook/">Peter Ledbrook&#8217;s posts</a> on the SpringSource blog are vital references for the Grails developer.</li>
<li>SkillsMatter publishes all the videos for the Grails Exchange in London for free every year. The collection of presentations is pretty impressive. (<a href="http://skillsmatter.com/event/java-jee/groovy-grails-exchange-2010">2010 </a>| <a href="http://skillsmatter.com/event/java-jee/groovy-grails-exchange-2009">2009</a> )</li>
</ul>
<p><strong>3. Answer one question on the grails-user mailing list every week.</strong></p>
<p>One of the things I like to do is to challenge myself to answer one question in the <a href="http://www.grails.org/Mailing+lists">grails-user mailing list</a> every week. Answering just one question forces me to sift through all the new questions coming through and seeing if I can find a quick and easy solution to a real world question.</p>
<p>Instead of answering something I already know, I try to pick a question that might take 5-10 minutes to answer. More often than not, the questions will force me dig into the code of a plugin or try to do something different within the grails console.</p>
<p>For me, this is the easiest way to come up with a guided exploration of ideas and concepts within Grails. I highly recommend it.</p>
<p><strong>4. Read plugin source code and samples.</strong></p>
<p>Something I found myself doing a lot is digging into the source of plugins like <a href="https://github.com/geb/geb">Geb</a> or <a href="http://plugins.grails.org/grails-app-info/">App-info</a> and seeing how everything connects together. Other times, I find myself digging into smaller plugins like <a href="http://plugins.grails.org/grails-taggable/">Taggable</a> to understand how other people implement certain things.</p>
<p>I found exploring other people&#8217;s code allows me to add to my groovy manna that I can then use when writing my own code and plugins.</p>
<p>Another useful exploration is to expand the source code of the tag libraries within the Grails documentation by clicking Show Source. One of the better surprises for me recently is seeing how elegant the scopes within the <a href="http://www.grails.org/doc/1.3.x/ref/Tags/set.html#set">g:set</a> tag were implemented.</p>
<p>A final useful tool is to see and read the code that other people have written for the <a href="http://groovyconsole.appspot.com/">groovy web console</a>.</p>
<p><strong>5. Talk at / attend a conference or user group meeting. </strong></p>
<p>One of the more interesting experiences of my programmer life has come from talking at Grails conferences and user groups. There is just something about condensing the stuff you have learned and talking about it for an hour in a way that doesn&#8217;t put your audience to sleep. It forces you to spread out your thoughts and carefully examine the work you do. I highly recommend it.</p>
<p>If you rather just listen, there are a bunch of <a href="http://www.grails.org/User+Groups">User Group Meetings</a>.</p>
<p>A few conferences are also coming up to learn more about Grails, including <a href="http://www.springone2gx.com/conference/chicago/2011/10/home">SpringOne2GX</a>, <a href="http://skillsmatter.com/event/groovy-grails/groovy-grails-exchange-2011">Groovy and Grails Exchange</a>, <a href="http://greach.es/">Greach</a> and the <a href="http://www.gr8conf.org/">GR8Conf</a>. I highly recommend attending those.</p>
<p><strong>6. Work on a real project.</strong></p>
<p>Of course, there is no better way to learn Grails than to interact with a real team of developers and work on a real project from start to finish. I&#8217;ve often found that the work we do day-to-day helps guide a lot of the blog posts and plugins I end up writing.</p>
<p>Many of my recent plugins like <a href="http://grails.org/plugin/cdn-resources">CDN-resources</a>, <a href="http://grails.org/plugin/website-optimizer">Website Optimizer</a> and <a href="http://grails.org/plugin/inviter">Inviter</a> have come from requirements in our projects. I find that by pairing and working with other people, the way in which I write code just gets better by leaps and bounds.</p>
<p>There seems to be a lot of opportunities popping up, you can always check <a href="http://www.grailsjobs.com/">Grails Jobs</a> for the latest listings.</p>
<p><em><strong>Shameless plug</strong></em></p>
<p>Finally, if you&#8217;re in London and would like to learn more about Grails, why not consider working with Secret Escapes. We are looking for <a href="http://secretescapes.easyjobboards.com/jobs/4685/junior-grails-developer/">talented Grails developers</a>, so get in touch.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1129/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1129/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1129/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1129&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2011/10/24/six-ways-to-become-a-better-grails-programmer/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
		<item>
		<title>Migrating from the Grails UI-performance plugin to resources plugin.</title>
		<link>http://fbflex.wordpress.com/2011/10/21/migrating-from-the-grails-ui-performance-plugin-to-resources-plugin/</link>
		<comments>http://fbflex.wordpress.com/2011/10/21/migrating-from-the-grails-ui-performance-plugin-to-resources-plugin/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 21:36:48 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1124</guid>
		<description><![CDATA[The UI-performance plugin has been a standard for managing images, css and javascript files for many grails applications. In the upcoming Grails 2.0 release, however, it seems that the recommended way of managing resources is via the Resources plugin. Many &#8230; <a href="http://fbflex.wordpress.com/2011/10/21/migrating-from-the-grails-ui-performance-plugin-to-resources-plugin/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1124&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://grails.org/plugin/ui-performance">UI-performance</a> plugin has been a standard for managing images, css and javascript files for many grails applications. In the upcoming Grails 2.0 release, however, it seems that the recommended way of managing resources is via the <a href="http://grails.org/plugin/resources">Resources plugin</a>.</p>
<p>Many of the posts on the web ( like <a href="http://www.anyware.co.uk/2005/2011/09/12/optimising-your-application-with-grails-resources-plugin/">this one</a>, or <a href="http://blog.springsource.com/2011/06/30/countdown-to-grails-2-0-static-resources/">this one</a> )describe how to get started with the Resources plugin from scratch. However, chances are that your project already uses UI-performance. How easy is it to migrate an existing project to use Resources?</p>
<p>In this post, I would like to document the steps we took to migrate our Grails project from the UI-performance plugin to the new resources plugin.<br />
<span id="more-1124"></span></p>
<h2><span style="text-decoration:underline;">Steps</span></h2>
<p><strong>1. Uninstall UI-performance</strong></p>
<p>You do this by <code>grails uninstall-plugin ui-performance</code></p>
<p><strong>2. Install resources plugin</strong></p>
<p><code>Grails install-plugin resources.</code></p>
<p>You might be tempted to install all the other related plugins at this point, but I would recommend just sticking with vanilla versions of the plugin.</p>
<p><strong>3. Replace all references to ui-performance tags with new resources tags.</strong></p>
<p>For this, I wrote a simple tag library that simply maps the UI-performance tags to resources tags</p>
<p><pre class="brush: groovy;">
package com.flashsales.utils

// maps UI Performance tags to resources plugin tags
class ConvertUiPerformanceTagLib {

	static namespace = 'p'

	def css = { attrs -&gt;
		attrs.uri = &quot;/css/${ attrs.remove( 'name' ) }.css&quot;
		attrs.type = 'css'
		out &lt;&lt; r.external( attrs ) 	} 	def image = { attrs -&gt;
		attrs.uri = '/images' + attrs.remove( 'src' )
		out &lt;&lt; r.img( attrs ) 	} 	def javascript = { attrs -&gt;
		attrs.uri = &quot;/js/${ attrs.remove( 'src' ) }.js&quot;
		attrs.type = 'js'
		out &lt;&lt; r.external( attrs )
	}

	//  TODO: imageLink, favicon, inputImage, sprite, dependantJavascript and addJavaScript

}
</pre></p>
<p>UI-performance assumes certain defaults for directories, which resources does not. Using a tag library makes it easy to switch back and forth between the two plugins.</p>
<p>One thing that is important for these tags is that you can&#8217;t use relative paths in your file references. So if your tag is &lt;p:image src=&#8221;myfolder/image1.jpg&#8221;/&gt;, you need to change it to &lt;p:image src=&#8221;/myfolder/image1.jpg&#8221; /&gt;</p>
<p>In our application, we don&#8217;t use sprites or the dependantJavascript tag, but you could write similar taglib code to override this.</p>
<p><strong>4. [Optional] Add tags to your layouts to include the tags used by resources plugin to provide &#8216;<a href="http://www.anyware.co.uk/2005/2009/01/19/an-idea-to-give-grails-tags-esp/">ESP</a>&#8216;</strong></p>
<p>At this point, you will want to change your layouts to include JavaScript resources in your application&#8217;s head and body.</p>
<p>Go through each of your layout files and add a &lt;r:layoutResources/&gt; tag in your head and body sections. This step is useful if you wish to leverage other features of the resources plugin in the future, but is not necessary for translating uiperf to resources.</p>
<p><strong>5. Run your application and make sure everything renders correctly.</strong></p>
<p>Try your application with both grails run-app and grails run-war to see that it works in the way you want it to work.</p>
<p><strong>6. [Optional] </strong><strong>Define modules.</strong></p>
<p>One of the more powerful features of the resources plugin is the ability to define  modules that encapsulate a series of resources. One of the main benefits of this approach is that it guarantees that all your javascript and css files get included correctly, and they appear on the right place in your page. It also makes the inclusion of resources less verbose, as you can bundle several js files and css files together.</p>
<p>On the other hand, changing resources to modules is also tedious and error prone if you already have a bunch of resources defined with the Ui-performance plugin. You have to go through each page of your site that has a &lt;p:whatever/&gt; tag and refactor these to use the new &lt;r:require&gt; tags.</p>
<p>If you choose to declare modules, you will have to introduce a new file called ApplicationResources.groovy and follow the instructions in the plugin <a href="http://grails-plugins.github.com/grails-resources/">user guide</a>.</p>
<p><strong>7. [Optional] Change your tags from r:external to r:require.</strong></p>
<p>If you have defined a module in the previous step, you will wish to change the parts in your code that reference the old css and javascripts, and replace them with the new, simpler &lt;r:require tags/&gt; for the modules. It really depends on why you want to switch from one plugin to the other.</p>
<p><strong>8. Add additional support plugins and make sure that everything works correctly.</strong></p>
<p>For our application, we&#8217;re adding the cached-resources, cdn-resources, less-resources and zipped-resources plugins. For this step, we install each plugin individually and make sure that they work correctly. Refer for each plugin documentation for additional steps. For the CDN-resources plugin, for example, I had to go ahead and set up a CDN location for my application.</p>
<p><strong>9. Test and Deploy.</strong></p>
<h2><span style="text-decoration:underline;">Discussion</span></h2>
<p>If the UI-performance plugin works well for you, there is really no reason to migrate to the new resources plugin mechanism.</p>
<p>For us, there were two things that we are currently doing that made us want to switch to Resources:</p>
<ol>
<li>we started using <a href="http://lesscss.org/">LESS</a> and it felt that this is slightly better supported by the resources plugin than by UI-performance.</li>
<li>We wanted to use a CDN. Although we got UI performance to work with a CDN, the version of the plugin that included the <a href="http://jira.grails.org/browse/GPUIPERFORMANCE-64">patch</a> ( 1.2.2. trunk ) had some issues dealing with images in css files. At the end of the day, it felt safer to write a simple mapper to <a href="http://grails.org/plugin/cdn-resources">enable CDN support</a>.</li>
<li>Cached-resources is more efficient than the current way in which UI-performance handles versioning.
<p>In UI-performance, a new CSS, image and JS file gets created and downloaded by the client whenever a new War is pushed.</p>
<p>Given that we follow principles of continous deployment, it meant our clients kept downloading the same images over and over again. Using Cached resources means that we are able to reduce the number of files being downloaded by our clients.</li>
<li>We like the notion of modules and feel that this is something we would like to refactor our code to use.</li>
</ol>
<p>Hopefully, you would agree that the process of transitioning an existing project that uses the ui-performance plugin into resources plugin is fairly seamless and pain free.</p>
<h2></h2>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1124/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1124/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1124/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1124&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2011/10/21/migrating-from-the-grails-ui-performance-plugin-to-resources-plugin/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
		<item>
		<title>Job specs that make your team shine &#8211; building a spec with your development team</title>
		<link>http://fbflex.wordpress.com/2011/10/20/job-specs-that-make-your-team-shine-building-a-spec-with-your-development-team/</link>
		<comments>http://fbflex.wordpress.com/2011/10/20/job-specs-that-make-your-team-shine-building-a-spec-with-your-development-team/#comments</comments>
		<pubDate>Thu, 20 Oct 2011 10:14:44 +0000</pubDate>
		<dc:creator>Tomas Lin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fbflex.wordpress.com/?p=1120</guid>
		<description><![CDATA[Secret Escapes is a great place to work for. Our team is multi-cultural and fun, we use the latest tools in the Grails ecosystem, and we work very well together. However, I always found it difficult to present this to &#8230; <a href="http://fbflex.wordpress.com/2011/10/20/job-specs-that-make-your-team-shine-building-a-spec-with-your-development-team/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1120&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.secretescapes.com">Secret Escapes</a> is a great place to work for. Our team is multi-cultural and fun, we use the latest tools in the <a href="http://www.grails.org">Grails</a> ecosystem, and we work very well together.</p>
<p>However, I always found it difficult to present this to job applicants. Our initial <a href="http://www.grailsjobs.com/view-job/253">job postings</a> where hastily copied from other job postings and failed to present our culture of sharing and collaboration.</p>
<p>We recently had an opening for a Junior Grails Developer, and I thought it would be interesting to have the team help me come up with a new job spec that would reflect the company they would be working with.</p>
<p>After a couple of hours, we came up with a new job description that we think presented our development team much better.</p>
<p>In the old spec, we focused a lot on the technology side of things. For developers working in the Java world, having the ability to play with Grails and Groovy is certainly very appealing. But this alone would not convince me to send my CV over to a new company. We tried to make it very clear about the type of people we wanted and the type of team we are. <span id="more-1120"></span></p>
<p><strong>What makes us different?</strong></p>
<p>The new spec now has a section that asks, &#8216;what is it like working with us?&#8217;.</p>
<p>What is interesting about this section is that it really reflected our development vision and culture.</p>
<p>The other developers and I are big fans of not just writing code, but crafting it and making sure that it not only works, but that it is easy to maintain and fully tested.</p>
<p>When reading other job specs, it was very hard to figure out what these other companies were like. By sitting down with my development team and asking them: &#8216;so, what makes working with us that is different than some big stuffy bank?&#8217;, we were able to come up with a better description of how we work.</p>
<p>This is what we came up with:</p>
<p style="padding-left:30px;"><span style="color:#808080;">Why work with us? Our developers say:</span></p>
<ul style="padding-left:30px;">
<li><span style="color:#808080;">We&#8217;re open to exploring and improving the ways in which we build software. We&#8217;re a team that embraces change and want to work with the best tools, processes and people.</span></li>
<li><span style="color:#808080;">We continuously rotate our tasks while supporting and learning from each other.</span></li>
<li><span style="color:#808080;">We are a young multi-cultural team.</span></li>
<li><span style="color:#808080;">We socialize as a team. From team lunches on Thursdays to GGUG meetings, we have fun.</span></li>
<li><span style="color:#808080;">We work closely with the business. We sit in the same space with the key stake holders. You get to see the impact of your work right away and get immediate feedback.</span></li>
<li style="padding-left:30px;"><span style="color:#808080;">We believe in working with open source, blog furiously and have released many plugins into the Grails ecosystem.</span></li>
</ul>
<p><strong>Who are we looking for?</strong></p>
<p>One of the things that we discussed at a recent retrospective was getting the team more involved in the hiring process. This lead to a quick discussion about the characteristics of new people we want to bring into our team. Writing the job spec allowed to define the characteristics about this person that was not about technical skills, but also about how they approached writing and building applications.</p>
<p>This is how it looks like:</p>
<p style="padding-left:30px;"><span style="color:#808080;">Who are we looking for?</span></p>
<ul style="padding-left:60px;">
<li><span class="Apple-style-span" style="color:#808080;">You are willing to explore new ideas and try out new tools.</span></li>
</ul>
<ul style="padding-left:60px;">
<li><span style="color:#808080;">You treat programming like a craft, code cleanly, and want to get better at it each day.</span></li>
</ul>
<ul style="padding-left:60px;">
<li><span style="color:#808080;">You appreciate that your code supports a business and care about how it will be used.</span></li>
</ul>
<ul style="padding-left:60px;">
<li><span style="color:#808080;">You like the idea of dynamic languages, and want to work with world-class Groovy and Grails developers with lots of experience. This is a role where you can get great mentorship.</span></li>
</ul>
<ul style="padding-left:60px;">
<li><span style="color:#808080;">You embrace agile principles like Test and Behaviour-driven-development,</span></li>
</ul>
<ul style="padding-left:60px;">
<li><span style="color:#808080;">Pair-programming and Continous Deployment.</span></li>
</ul>
<ul style="padding-left:60px;">
<li><span style="color:#808080;">You believe that great software is built through communication and collaboration.</span></li>
</ul>
<ul style="padding-left:60px;">
<li><span style="color:#808080;">You want to be proud describing the types of web applications you are working on.</span></li>
</ul>
<ul style="padding-left:60px;">
<li><span style="color:#808080;">You think staying in hotels is fun.</span></li>
</ul>
<p><strong>Conclusion</strong></p>
<p>For reference, this is how our old job spec looked like &#8211; <a href="http://www.grailsjobs.com/view-job/253">Click here</a>.</p>
<p>And this is how the new position looks like &#8211; <a href="http://secretescapes.easyjobboards.com/jobs/4685/junior-grails-developer/">Click here</a>.</p>
<p>After this exercise, it became very clear to me that job specs should always be written together by the team that is hiring.</p>
<p>Before, writing a job spec felt like a task that I wanted to get over with as soon as possible. By making it a collaborative task, it becomes enjoyable again because it forces us to really evaluate the must-haves about potential candidates and gets the whole team to agree on the qualities of the new candidate.</p>
<p>Shameless plug: we are hiring a new Junior Grails Developer in London. So please apply. We will also be at the <a href="http://www.siliconmilkroundabout.com/">Silicon Milkroundabout</a> on October 30, so stop by and have a chat.</p>
<p><strong>tl;dr &#8211; write job specs with your development team, because it&#8217;ll help you sync your brains</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/fbflex.wordpress.com/1120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/fbflex.wordpress.com/1120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/fbflex.wordpress.com/1120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/fbflex.wordpress.com/1120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/fbflex.wordpress.com/1120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/fbflex.wordpress.com/1120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/fbflex.wordpress.com/1120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/fbflex.wordpress.com/1120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/fbflex.wordpress.com/1120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/fbflex.wordpress.com/1120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/fbflex.wordpress.com/1120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/fbflex.wordpress.com/1120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/fbflex.wordpress.com/1120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/fbflex.wordpress.com/1120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=fbflex.wordpress.com&amp;blog=3300005&amp;post=1120&amp;subd=fbflex&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://fbflex.wordpress.com/2011/10/20/job-specs-that-make-your-team-shine-building-a-spec-with-your-development-team/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/4cdec8dc311c5d0b00d44413175bcf85?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chinito</media:title>
		</media:content>
	</item>
	</channel>
</rss>
