<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>

  var _gaq = _gaq || [];
  _gaq.push([‘_setAccount’, ‘UA-28261331-1’]);
  _gaq.push([‘_trackPageview’]);

  (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
  })();</description><title>GRAILS.IO</title><generator>Tumblr (3.0; @graemerocher)</generator><link>http://grails.io/</link><item><title>Road to Grails 2.3: RESTful URL Mappings and URL Mapping Reports</title><description>&lt;p&gt;In then next milestone of Grails 2.3 we&amp;#8217;re aiming to &lt;a href="https://github.com/grails/grails-core/wiki/Grails-2.3:-REST-Improvements"&gt;improve the REST support&lt;/a&gt; significantly and part of that is improved URL mapping.&lt;/p&gt;
&lt;p&gt;This week I pushed the updates to the implementation which includes:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Supports for singular and plural RESTful resources&lt;/li&gt;
&lt;li&gt;Nested RESTful resources&lt;/li&gt;
&lt;li&gt;Namespaces&lt;/li&gt;
&lt;li&gt;Easy linking to RESTful resources&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;To find out more checkout the &lt;a href="https://github.com/grails/grails-doc/commit/72f38dc5a95dbd3d1aedd17d2c99e45a4b3ca666"&gt;documentation updates&lt;/a&gt;. Oh and one final nicety is a new &amp;#8216;grails url-mappings-report&amp;#8217; command which produces the following report (for example):&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/f1a6ba8efd09cb649f2763384fdc236c/tumblr_inline_mmxt9jDP0Y1qz4rgp.png"/&gt;&lt;/p&gt;</description><link>http://grails.io/post/50643596608</link><guid>http://grails.io/post/50643596608</guid><pubDate>Fri, 17 May 2013 12:04:00 +0200</pubDate></item><item><title>Fantastic video produced by Orange and Bronze on “Why we...</title><description>&lt;iframe width="400" height="225" src="http://www.youtube.com/embed/yVwbPgJHTnA?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Fantastic video produced by &lt;a href="http://www.orangeandbronze.com"&gt;Orange and Bronze&lt;/a&gt; on “Why we love Grails”&lt;/p&gt;</description><link>http://grails.io/post/50077388854</link><guid>http://grails.io/post/50077388854</guid><pubDate>Fri, 10 May 2013 10:09:09 +0200</pubDate></item><item><title>Grails 2.3 M1 and Upcoming M2</title><description>&lt;p&gt;For those of you who missed the news, yes &lt;a href="http://grails.org/news/1286825"&gt;Grails 2.3 M1&lt;/a&gt; is out now!&lt;/p&gt;
&lt;p&gt;There is some great stuff in there, and fantastic contributions. &lt;a href="https://github.com/jeffbrown"&gt;Jeff Brown&lt;/a&gt; wrote the new Data Binding mechanism, &lt;a href="https://github.com/burtbeckwith"&gt;Burt Beckwith&lt;/a&gt; the Hibernate 4 support and &lt;a href="https://github.com/lhotari"&gt;Lari Hotari&lt;/a&gt; did wonderful work on XSS prevention and performance optimisation.&lt;/p&gt;
&lt;p&gt;Now we&amp;#8217;re focusing on Milestone 2, I&amp;#8217;m diving head first into the &lt;a href="https://github.com/grails/grails-core/wiki/Grails-2.3:-REST-Improvements"&gt;REST improvements&lt;/a&gt;, and Stephane Maldini is working on contributing the Async eventing APIs. All in all there are many exciting things coming in what will be in the final release in the 2.x line before we start on Grails 3.0!&lt;/p&gt;</description><link>http://grails.io/post/50077352016</link><guid>http://grails.io/post/50077352016</guid><pubDate>Fri, 10 May 2013 10:07:41 +0200</pubDate></item><item><title>More on "Where next for Grails"?</title><description>&lt;p&gt;Last week Peter Ledbrook wrote a nice summary of&lt;a href="http://www.cacoethes.co.uk/blog/groovyandgrails/where-next-for-grails"&gt; where we are at and where we should be going&lt;/a&gt; with Grails over the next few years.&lt;/p&gt;
&lt;p&gt;He made some interesting points, and it is true that Grails is indeed at an inflection point in its history. Application architectures are changing. The traditional model that the Servlet era APIs were designed for is becoming valid for fewer and fewer cases.&lt;/p&gt;
&lt;p&gt;Mobile and Rich web apps are driving this revolution. Many folks are simply serving up JSON to be consumed by rich clients. So where does Grails fit into this world? &lt;/p&gt;
&lt;p&gt;First of all, it is worth pointing out that Grails is not the only framework that is going to need to adapt to this new world. Pretty much every current popular web framework is going to have to make changes to support new architectural styles (including some of the official specifications from Oracle). This is already happening everywhere, and Grails is no exception.&lt;/p&gt;
&lt;p&gt;However, unlike many frameworks that only provide the View/Controller layer, Grails provides significant amounts of value beyond serving up GSP views. Grails is one of the few proven &amp;#8220;full stack&amp;#8221; environments used to build real world applications and adopted by thousands of developers world wide. They adopt it because it provides the out-of-the-box experience developers seek, including a compelling plugin eco-system.&lt;/p&gt;
&lt;p&gt;Grails is approaching 1000 plugins, the growth Grails has had in this area has been staggering. Many of the plugins are not tied to any particular architectural style. Persistence is a key area, and GORM has evolved from being based on Hibernate into supporting NoSQL databases like MongoDB, Neo4j and Amazon DynamoDB.&lt;/p&gt;
&lt;p&gt;However, when you issue a &amp;#8220;grails create-app&amp;#8221; command, currently only one architectural style is supported: the Servlet environment.  Grails only allows creation of applications served up by a Servlet container. Granted that is a lot of applications (Tomcat is extremely popular), but we believe the features offered by Grails are compelling outside this environment too.&lt;/p&gt;
&lt;p&gt;To adapt and evolve to this new world, Grails is going to have to change and that is why we are starting work on Grails 3.0 towards the 3rd quarter of this year.&lt;/p&gt;
&lt;p&gt;Grails 3.0 will be a reinvention of the framework that you love, and we will be making some hard decisions about what we support in terms of backwards compatibility. With Grails 3.0 we plan to allow the creation of applications in different architectural styles. Servlet API applications will always be supported, but we plan to make &amp;#8220;create-app&amp;#8221; extensible, so that Grails can be used to create a range of types of applications (Batch, NIO, Netty, &amp;#8220;static void main&amp;#8221; etc.).&lt;/p&gt;
&lt;p&gt;This will involve splitting Grails out further into a more modular system. The default plugins installed for a Servlet applications will be different for those for a Batch or Netty application. Packaging types will differ (WAR vs JAR vs&amp;#160;?). Even the set of command line commands you get at build time will differ based on the type of application you want to create. &lt;/p&gt;
&lt;p&gt;All of this will require refactoring and changes to our current build system (a shift to Gradle) and significant extensions to the plugin API. However, I believe we can make Grails applicable to a range of new use cases and create compelling environments that our users enjoy. &lt;/p&gt;
&lt;p&gt;Right now in Grails 2.3 we are laying some of the ground work for Grails 3.0 by making available APIs and tools that will be applicable in Grails 3.0 as well (The async and eventing APIs, new REST APIs forked execution everywhere etc.). All in all, it is an exciting time to be working on Grails, and I look forward to feedback from the community on our current direction.&lt;/p&gt;</description><link>http://grails.io/post/48599814766</link><guid>http://grails.io/post/48599814766</guid><pubDate>Mon, 22 Apr 2013 09:37:00 +0200</pubDate></item><item><title>Road to Grails 2.3: Async Support</title><description>&lt;p&gt;With Grails 2.2, we introduced some basic support for accessing the Servlet 3.0 async APIs. However, we knew then that the Servlet 3.0 API wasn&amp;#8217;t the programming model we wanted to expose to users. The reasons for this are:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;The Servlet 3.0 APIs are servlet specific&lt;/li&gt;
&lt;li&gt;Like the rest of the Servlet API they are low-level and verbose&lt;/li&gt;
&lt;li&gt;The Servlet 3.0 API is just not very Groovy&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Starting in Grails 2.3, we are introducing new APIs based around the notion of promises. A Promise is similar to a Java Future instance, but include a more user friendly exception handling model, useful features like chaining and the ability to attach listeners.&lt;/p&gt;
&lt;p&gt;A basic example of promises in Grails 2.3 can be seen below&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt;import static grails.async.Promises.*

def p1 = task { 2 * 2 }
def p2 = task { 4 * 4 }
def p3 = task { 8 * 8 }
assert [4,16,64] == waitAll(p1, p2, p3)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above example creates 3 async tasks and then waits synchronously for them to complete. Of course, fitting asynchronous programming APIs into a full stack framework requires a lot more than exposing a nice API for programming concurrently.&lt;/p&gt;
&lt;p&gt;From a Grails perspective, how do the Async APIs fit into controllers? How do they work with GORM? What about Transactions?&lt;/p&gt;
&lt;p&gt;There is a whole bunch of considerations, and we&amp;#8217;ve tried to resolve all of these within an elegant API.&lt;/p&gt;
&lt;p&gt;With GORM, we have introduced a new &amp;#8220;async&amp;#8221; namespace, that allows all of the regular GORM query methods to a return a promise:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
import static grails.async.Promises.*
def p1 = Person.async.get(1L)
def p2 = Person.async.get(2L)
def p3 = Person.async.get(3L)
def results = waitAll(p1, p2, p3)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Grails will automatically deal with the intricacies of opening a Hibernate session for the background thread, closing it when it is done and so on. You can even batch up multiple queries using the &amp;#8220;task&amp;#8221; method:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
def promise = Person.async.task {
    withTransaction {
       def person = findByFirstName("Homer")
       person.firstName = "Bart"
       person.save(flush:true)    
    }
}
Person updatedPerson = promise.get()
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For controllers the advantage of Servlet 3.0 Async is that using a modern container (such as Tomcat 7.0) the link between request, response and thread can be broken. By handling a request asynchronously you can return the request thread to the container, whilst keeping the response open in a non-blocking fashion. This makes modern containers far more scalable, in particular when dealing with long running requests.&lt;/p&gt;
&lt;p&gt;With Grails 2.3 you can simply return a Promise from any action using the task method. The following example using the Yahoo Finance APIs:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
def stock(String ticker) {
   task {
       ticker = ticker ?: 'GOOG'
       def url = new URL("http://download.finance.yahoo.com/d/quotes.csv?s=${ticker}&amp;amp;f=nsl1op&amp;amp;e=.csv")
       Double price = url.text.split(',')[-1] as Double
       render "ticker: $ticker, price: $price"
   }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can also return an Async model, which is a map where the values are promises. The promises will be executed asynchronously and when ready the view rendered:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
import static grails.async.Promises.*
…
def index() {
   tasks books: Book.async.list(),
         totalBooks: Book.async.count(),
         otherValue: {
           // do hard work
         }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;For services it is quite typical to need both a synchronous and asynchronous version of your API. Unfortunately it is tedious and error prone to maintain both. To mitigate this problem Grails 2.3 features a DelegateAsync transformation which takes any normal Grails service and exposes asynchronously.&lt;/p&gt;
&lt;p&gt;For example take the following service:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
class BookService {    
    List findBooks(String title) {
      // implementation
    }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you wish to expose this in an asynchronous manner simply create a new class that uses the DelegateAsync annotation:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
import grails.async.*
class AsyncBookService {
   @DelegateAsync BookService bookService    
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Every method from the original service will execute asynchronously returning a Promise:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
AsyncBookService asyncBookService
def findBooks(String title) {
    asyncBookService.findBooks(title)
       .onComplete { List results -&amp;gt;
          println "Books = ${results}"    			
       }
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If the service is transactional the Promise execution will wrapped in a transaction. If you use the @Transactional annotation then the annotation attributes defined in the annotation will be used when creating the transaction.&lt;/p&gt;
&lt;p&gt;All of this is just a preview of what is to come (if you want to find out more checkout &lt;a href="https://github.com/grails/grails-doc/commit/88abe7cf9aae587a40a364a26e58eff029021b46"&gt;this commit&lt;/a&gt; to the docs). We&amp;#8217;re inching closer to the first 2.3 milestone release, so stay tuned for more.&lt;/p&gt;</description><link>http://grails.io/post/45774038833</link><guid>http://grails.io/post/45774038833</guid><pubDate>Tue, 19 Mar 2013 20:54:36 +0100</pubDate></item><item><title>Little Goblin: Grails-based browser game framework</title><description>&lt;a href="http://littlegoblin.de/goblinDoc/hub/index"&gt;Little Goblin: Grails-based browser game framework&lt;/a&gt;: &lt;p&gt;Interesting project to create a browser game framework for Grails&lt;/p&gt;</description><link>http://grails.io/post/43511872061</link><guid>http://grails.io/post/43511872061</guid><pubDate>Tue, 19 Feb 2013 22:53:46 +0100</pubDate></item><item><title>Road to Grails 2.3: Forked Execution</title><description>&lt;p&gt;In previous versions of Grails everything we did has been in-process. In other words, when you run something like &amp;#8216;grails run-app&amp;#8217; the Tomcat container would live in the same JVM process as the &amp;#8216;grails&amp;#8217; command. Likewise if your run &amp;#8216;grails test-app&amp;#8217; the tests are run in the same process as the &amp;#8216;grails&amp;#8217; command&lt;/p&gt;
&lt;p&gt;This has several issues, some of which are listed below:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Memory strain - since the build system and the container share the same process, this puts memory pressure on the single JVM process making it hard to identify at development time your applications memory requirements&lt;/li&gt;
&lt;li&gt;Classpath isolation - build time only dependencies &amp;#8220;leak&amp;#8221; into your application. So your application sees classes that were only meant to be seen by the Grails build system. This can lead to behaviour that worked during &amp;#8216;run-app&amp;#8217; but failed upon WAR deployment.&lt;/li&gt;
&lt;li&gt;MetaClass conflicts - This is a particular issue of a dynamic language like Groovy. If you modify the MetaClass of a class, a quite common practise during testing for example, this change is seen JVM wide. Quite a few people have stumbled into issues running &amp;#8216;test-app&amp;#8217; whilst the container was running (from interactive mode) and seeing their running applications behaviour change.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;So as you can see in retrospect allowing everything to happen in a single process was a design error in the framework from the beginning.&lt;/p&gt;
&lt;p&gt;So in Grails 2.3 we are changing Grails to fork a new process for things like run-app, run-war and test-app. You will still be able to revert back to running in the same JVM if you rely on the previous behaviour (not something we recommend), but the default will be forked execution. The parameters to the forked JVM can be controlled via configuration in BuildConfig.groovy which defaults to:&lt;/p&gt;

&lt;pre class="prettyprint"&gt;&lt;code&gt; 
forkConfig = [maxMemory: 1024, minMemory: 64, debug: false, maxPerm: 256]
grails.project.fork = [
   test: forkConfig, // configure settings for the test-app JVM
   run: forkConfig, // configure settings for the run-app JVM
   war: forkConfig, // configure settings for the run-war JVM
   console: forkConfig // configure settings for the Swing console JVM
]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can tweak the memory and debug requirements of the forked JVM as needed for testing or execution of the application.&lt;/p&gt;
&lt;p&gt;Note that one particular challenge with this new approach is that spinning up a new JVM is an expensive operation. So we have taken an approach similar to the &lt;a href="https://github.com/flatland/drip"&gt;Drip&lt;/a&gt; tool that maintains a pre-intialized JVM behind the scenes ready for execution.&lt;/p&gt;
&lt;p&gt;This only works via interactive mode, so for 2.3 and above it becomes even more important to start Grails with the &amp;#8216;grails&amp;#8217; command and then run &amp;#8216;test-app&amp;#8217; from interactive mode. When starting interactive mode Grails will keep a pre-intialized JVM running in the background to quickly execute unit tests. In our testing there is not a noticeable difference in performance between this approach and running tests inline in the same JVM.&lt;/p&gt;
&lt;p&gt;Lookout for the new forked execution feature in Grails 2.3 M1, which we are targeting for release within the next few weeks.&lt;/p&gt;</description><link>http://grails.io/post/43484836985</link><guid>http://grails.io/post/43484836985</guid><pubDate>Tue, 19 Feb 2013 15:02:37 +0100</pubDate></item><item><title>Road to Grails 2.3: Improved Dependency Resolution</title><description>&lt;p&gt;During the various Grails conferences last year (2GX, Gr8conf, Grails Exchange etc.) there were significant numbers of people who commented that dependency resolution was their biggest problem with Grails.&lt;/p&gt;
&lt;p&gt;We&amp;#8217;ve made improvements in this area already, in Grails 2.1 we introduced proper &lt;a href="http://grails.org/doc/2.1.x/guide/introduction.html#whatsNew21"&gt;Maven support&lt;/a&gt;, but that still requires you to use the Maven build tool. Folks using the normal Grails command line have been stuck with Ivy. Starting with the upcoming Grails 2.3 release you will be able to switch to &lt;a href="http://www.eclipse.org/aether/"&gt;Aether&lt;/a&gt; as the default dependency manager by adding the following line to your BuildConfig:&lt;/p&gt;
&lt;p&gt;grails.project.dependency.resolver = &amp;#8220;maven&amp;#8221;&lt;/p&gt;
&lt;p&gt;What is Aether? Aether is the dependency resolution library used by Maven itself for resolution. What this means is that several problems users have had with Ivy go away, including:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://grails.org/doc/2.2.x/guide/conf.html#changingDependencies"&gt;Problematic&lt;/a&gt; snapshot handling (Ivy doesn&amp;#8217;t deal with snapshots the same as Maven)&lt;/li&gt;
&lt;li&gt;Issues with different packaging types used in POMs&lt;/li&gt;
&lt;li&gt;Lack of support for repository URLs in POMs (although this is discouraged)&lt;/li&gt;
&lt;li&gt;Problems with complex POMs and classifiers&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;In addition to this, to help users diagnose dependency resolution failures we have shamelessly borrowed/stolen Gradle&amp;#8217;s dependency graph output for Grails&amp;#8217; dependency-report command:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/4566918657cc2575f2a58141a8eb2b6d/tumblr_inline_mgd3j16mYN1r5nkfb.png"/&gt;&lt;/p&gt;
&lt;p&gt;And when you get dependency resolution failures you get nice output highlighting the dependency that failed to resolve:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://media.tumblr.com/6dc60f2051ddf21eb811c74cc124731b/tumblr_inline_mgd3kwnaLL1r5nkfb.png"/&gt;&lt;/p&gt;

&lt;p&gt;There have been numerous internal framework improvements as well to reduce the number of dependency, cleanup Grails&amp;#8217; transitive dependencies and ensure issues like 2 plugins with the same version conflicting don&amp;#8217;t happen.&lt;/p&gt;
&lt;p&gt;Of course, we still have on the roadmap to move to Gradle in Grails 3.0, but in the meantime Grails 2.x users should have something to look forward to ease any dependency resolution woes.&lt;/p&gt;</description><link>http://grails.io/post/40093552028</link><guid>http://grails.io/post/40093552028</guid><pubDate>Wed, 09 Jan 2013 15:21:02 +0100</pubDate><category>grails</category><category>roadmap</category><category>maven</category><category>ivy</category><category>dependencies</category></item><item><title>Grails Unit Testing and a little fun with @Before</title><description>&lt;a href="http://www.mopri.de/2013/grails-unit-testing-and-a-little-fun-with-before/"&gt;Grails Unit Testing and a little fun with @Before&lt;/a&gt;: &lt;p&gt;Interesting post, the unpredictable ordering of JUnit @Before methods is a real problem. Anyone know a solution to this for JUnit 4?&lt;/p&gt;</description><link>http://grails.io/post/39464311752</link><guid>http://grails.io/post/39464311752</guid><pubDate>Wed, 02 Jan 2013 10:44:03 +0100</pubDate><category>grails</category><category>testing</category><category>junit</category></item><item><title>Grails 2.2 Released!</title><description>&lt;a href="http://grails.org/news/1285958"&gt;Grails 2.2 Released!&lt;/a&gt;</description><link>http://grails.io/post/38384905326</link><guid>http://grails.io/post/38384905326</guid><pubDate>Thu, 20 Dec 2012 16:09:55 +0100</pubDate><category>grails</category><category>announcements</category></item><item><title>Excellent Building Google Calendar in Grails Tutorial Series</title><description>&lt;a href="http://www.craigburke.com/blog/2012/02/18/creating-google-calendar-in-grails-part-3-creating-and-modifying-events/"&gt;Excellent Building Google Calendar in Grails Tutorial Series&lt;/a&gt;: &lt;p&gt;Craig Burke has put together an excellent series demonstrating building a Google Calendar type application using Grails and jQuery.&lt;/p&gt;</description><link>http://grails.io/post/19236792597</link><guid>http://grails.io/post/19236792597</guid><pubDate>Tue, 13 Mar 2012 16:19:11 +0100</pubDate><category>grails</category><category>2.0</category><category>jquery</category></item><item><title>The MongoDB NoSQL Database Blog: Groovy on Grails in the Land of MongoDB</title><description>&lt;a href="http://blog.mongodb.org/post/18510469058/groovy-on-grails-in-the-land-of-mongodb"&gt;The MongoDB NoSQL Database Blog: Groovy on Grails in the Land of MongoDB&lt;/a&gt;: &lt;p&gt;&lt;a class="tumblr_blog" href="http://blog.mongodb.org/post/18510469058/groovy-on-grails-in-the-land-of-mongodb"&gt;mongodb&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Groovy and Grails’ speed and simplicity are a perfect match to the flexibility and power of MongoDB. Dozens of plugins and libraries connect these two together, making it a breeze to get Grooving with MongoDB.&lt;/p&gt;
&lt;h4&gt;Using Grails with MongoDB&lt;/h4&gt;
&lt;p&gt;For the purpose of this post, let’s pretend we’re writing a…&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://grails.io/post/18544364593</link><guid>http://grails.io/post/18544364593</guid><pubDate>Thu, 01 Mar 2012 09:08:33 +0100</pubDate><category>grails</category><category>mongodb</category></item><item><title>Grails 2.0.1 Available...</title><description>&lt;p&gt;Today we &lt;a href="http://grails.org/2.0.1+Release+Notes"&gt;put out Grails 2.0.1&lt;/a&gt;, we&amp;#8217;ve been keeping our eyes open for folks who are having trouble upgrading and trying to proactively fix the issues that people encounter during an upgrade.&lt;/p&gt;
&lt;p&gt;Grails 2.0.1 is the result of that work and includes over 80 bug fixes and improvements, hopefully paving the way for more folks to upgrade. &lt;/p&gt;
&lt;p&gt;Let us know if you&amp;#8217;re having trouble and we&amp;#8217;ll prioritize the issue.&lt;/p&gt;</description><link>http://grails.io/post/17611574431</link><guid>http://grails.io/post/17611574431</guid><pubDate>Tue, 14 Feb 2012 18:09:42 +0100</pubDate><category>grails</category><category>releases</category><category>2.0.1</category><category>2.0</category></item><item><title>Chronic iMac Wifi Kernel Panics in Lion</title><description>&lt;p&gt;Dear Apple, I want to like Lion I really do, but as of today I cannot recommend anyone upgrading to it if you own an iMac (mid 2011). I personally am going to downgrade to Snow Leopard at the next available opportunity.&lt;/p&gt;
&lt;p&gt;There are chronic Wifi related kernels panics that are seemingly going unaddressed by Apple. I personally have 3 or 4 kernel panics per day (using 10.7.3). There are &lt;a href="https://discussions.apple.com/thread/3194446?start=0&amp;amp;tstart=0"&gt;multiple&lt;/a&gt;&lt;a href="https://discussions.apple.com/message/15780717#15780717"&gt; threads&lt;/a&gt; on the topic in the Apple support forums. Some schools have dozens of machines impacted. This is not an isolated problem. Some have indicated that replacing the Lion Wifi driver with the Snow Leopard one resolves the problem. Not for me.&lt;/p&gt;
&lt;p&gt;It seems the only way to have a stable iMac system with Lion is to disable Wifi. Completely unacceptable that, considering the issue doesn&amp;#8217;t occur if I run Windows in Bootcamp and didn&amp;#8217;t occur with Snow Leopard.&lt;/p&gt;
&lt;p&gt;Apple please, sort it out. Rant over.&lt;/p&gt;</description><link>http://grails.io/post/17367846565</link><guid>http://grails.io/post/17367846565</guid><pubDate>Fri, 10 Feb 2012 12:31:12 +0100</pubDate><category>apple</category><category>lion</category><category>osx</category></item><item><title>O'Reilly: Mastering Grails 101 Video</title><description>&lt;a href="http://shop.oreilly.com/product/0636920024798.do"&gt;O'Reilly: Mastering Grails 101 Video&lt;/a&gt;: &lt;p&gt;Check out this 3 hour+ screencast of starting out with Grails 2.0 by the excellent duo Tim Berglund and Matthew McCullough. Nice to see some professional level screencasts out there.&lt;/p&gt;</description><link>http://grails.io/post/16913776488</link><guid>http://grails.io/post/16913776488</guid><pubDate>Thu, 02 Feb 2012 09:45:00 +0100</pubDate><category>grails</category><category>2.0</category><category>screencasts</category><category>tutorials</category><category>beginners</category></item><item><title>Call for testing of existing Maven plugin</title><description>&lt;p&gt;If anybody out there has the time please test out Maven plugin for Grails 2.0 and report back any issues. Instructions for setup can be &lt;a href="http://jira.grails.org/browse/MAVEN-162"&gt;found here&lt;/a&gt;.&lt;/p&gt;</description><link>http://grails.io/post/16859071850</link><guid>http://grails.io/post/16859071850</guid><pubDate>Wed, 01 Feb 2012 11:27:54 +0100</pubDate><category>grails</category><category>2.0</category><category>maven</category></item><item><title>Nice installing Grails 2.0 on OS X screencast for beginners. See...</title><description>&lt;iframe width="400" height="225" src="http://www.youtube.com/embed/cMUsVhBINMQ?wmode=transparent&amp;autohide=1&amp;egm=0&amp;hd=1&amp;iv_load_policy=3&amp;modestbranding=1&amp;rel=0&amp;showinfo=0&amp;showsearch=0" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Nice installing Grails 2.0 on OS X screencast for beginners. See also &lt;a href="http://www.youtube.com/watch?v=N5mG7xxdVdE"&gt;Installing Grails 2.0 on Windows&lt;/a&gt; for those less fortunate.&lt;/p&gt;</description><link>http://grails.io/post/16827754391</link><guid>http://grails.io/post/16827754391</guid><pubDate>Tue, 31 Jan 2012 20:01:59 +0100</pubDate><category>grails</category><category>2.0</category><category>screencasts</category></item><item><title>Functional testing Grails core with Gradle, Spock and Geb</title><description>&lt;p&gt;Today I pushed a new &lt;a href="https://github.com/grails/grails-functional-tests-v2"&gt;functional test suite&lt;/a&gt; for Grails that is based on &lt;a href="http://gradle.org"&gt;Gradle&lt;/a&gt;, &lt;a href="http://spockframework.org"&gt;Spock&lt;/a&gt; and &lt;a href="http://www.gebish.org"&gt;Geb&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I have been relatively frustrated with our existing functional test suite and wanted to modernize it to take advantage of all the latest innovations happening in the Groovy testing community.&lt;/p&gt;
&lt;p&gt;The requirements fulfilled by the new test suite are as follows:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Allow tests to be created in a standard Gradle structure &lt;/li&gt;
&lt;li&gt;Allow tests to be run from the IDE&lt;/li&gt;
&lt;li&gt;Enable easy scripting of the Grails command line&lt;/li&gt;
&lt;li&gt;Enable easy web function testing of the running application&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;An example of what I came up with can be seen below:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; class RunAppSpec extends BaseSpec { void "Test run-app starts correctly"() { given:"A new project" grails { createApp "test" runApp() } when:"The home page is requested" go "" then:"The Grails welcome page is shown" title == "Welcome to Grails" } } &lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;As you can see the Grails command line can be easily scripted with the &lt;code&gt;grails&lt;/code&gt; block. Then testing of web UIs is left to Geb&amp;#8217;s DSL.&lt;/p&gt;
&lt;p&gt;Hopefully this will also make it easier for folks to contribute functional tests. Please feel free to fork the repository and send us a pull request!&lt;/p&gt;</description><link>http://grails.io/post/16065252638</link><guid>http://grails.io/post/16065252638</guid><pubDate>Wed, 18 Jan 2012 17:34:00 +0100</pubDate><category>grails</category><category>functional</category><category>testing</category><category>spock</category><category>geb</category></item><item><title>Object Partners posted a nice presentation on what is new in...</title><description>&lt;iframe src="http://player.vimeo.com/video/35162147" width="400" height="300" frameborder="0"&gt;&lt;/iframe&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Object Partners posted &lt;a href="http://www.objectpartners.com/2012/01/17/presentation-grails-2-0-what-to-be-excited-about/?utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+ObjectPartnersIncBlog+%28Object+Partners+Inc+%C2%BB+Blog%29"&gt;a nice presentation on what is new in Grails 2.0.&lt;/a&gt; &lt;/p&gt;</description><link>http://grails.io/post/16056198354</link><guid>http://grails.io/post/16056198354</guid><pubDate>Wed, 18 Jan 2012 10:27:35 +0100</pubDate><category>grails</category><category>2.0</category><category>presentations</category></item><item><title>Lessons learnt developing Groovy AST transformations</title><description>&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;Updated 17/01/2012:&lt;/strong&gt; Info on handling exceptions &lt;/p&gt;
&lt;p&gt;During the development of Grails 2.0 we shifted a significant amount of meta-programming logic to Groovy AST transformations. &lt;/p&gt;
&lt;p&gt;The advantages of AST transformations are several. More flexible DSLs can be created, you don&amp;#8217;t pay a runtime startup cost to use these DSLs and as a framework developer you can inline method calls where necessary.&lt;/p&gt;
&lt;p&gt;Having said that Groovy AST development has its dark sides and below I&amp;#8217;m going to list some lessons learnt developing AST transforms:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;1. Avoid Global Transforms&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Global AST transformations have their place, but they also have limitations. Their order is undetermined, you cannot have dependencies between transformations and they tend to be more difficult to debug.&lt;/p&gt;
&lt;p&gt;We ended up rolling our own equivalent to global transforms using Spring class path scanning and other the Spring Ordered interface to control ordering.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;2. Write Utility Methods&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;AST transformation code can be very repetitive. We ended up coming up with &lt;a href="https://github.com/grails/grails-core/blob/master/grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsASTUtils.java"&gt;GrailsASTUtils&lt;/a&gt; as well as a series of base classes to make common transforms easy. Things like adding a method that delegates to property (like Groovy&amp;#8217;s @Delegate) or the equivalent of Java reflection APIs for introspecting &lt;code&gt;ClassNode&lt;/code&gt; instances are available via &lt;code&gt;GrailsASTUtils&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We also wrote an alternative to Groovy&amp;#8217;s @Delegate called &lt;a href="https://github.com/grails/grails-core/blob/master/grails-core/src/test/groovy/org/codehaus/groovy/grails/compiler/injection/ApiDelegateSpec.groovy"&gt;ApiDelegate&lt;/a&gt; that allows you to get a reference to the delegating instance and honors any annotations found in methods of the delegate.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;3. Don&amp;#8217;t Reuse AST nodes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Say you have a reference to a &lt;a href="http://groovy.codehaus.org/api/org/codehaus/groovy/ast/ClassNode.html"&gt;ClassNode&lt;/a&gt; instance obtained by inspecting the AST you&amp;#8217;re transforming. Do NOT under any circumstances use this ClassNode to add a new method or property to the class being transformed. Doing stuff like:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
  MethodNode fooMethod = classNode.getMethod("foo", new Parameter[0]) 
  classNode.addMethod( new MethodNode("newMethod",                                       
                                       Modifier.PUBLIC, 
                                       fooMethod.getReturnType(),                                       
                                       new Parameter[0],                                      
                                       new ClassNode[0],
                                       methodBody);  ) )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Where you are reusing the &lt;code&gt;ClassNode&lt;/code&gt; returned from &lt;code&gt;getReturnType()&lt;/code&gt; is very dangerous and lead to all sorts of generics related errors. Always create a new &lt;code&gt;ClassNode&lt;/code&gt; reference from an existing one using &lt;code&gt;ClassHelper&lt;/code&gt;:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
  MethodNode fooMethod = classNode.getMethod("foo", new Parameter[0]) 
  classNode.addMethod( new MethodNode("newMethod",                                       
                                       Modifier.PUBLIC, 
                                       ClassHelper.make(fooMethod.getReturnType().getName()),                                       
                                       new Parameter[0],                                      
                                       new ClassNode[0],
                                       methodBody);  ) )
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The above using of &lt;code&gt;ClassHelper.make(..)&lt;/code&gt; will save you loads of time, trust me.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;4. Get comfortable with byte code and decompilers&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Nobody said writing AST transformations was for the feint hearted and if you&amp;#8217;re going to write any non-trivial transform you&amp;#8217;ll need to get comfortable with using &lt;code&gt;javap&lt;/code&gt; and a Java decompiler just in case something goes wrong in the byte code generation phase.&lt;/p&gt;
&lt;p&gt;I recommend &lt;a href="http://java.decompiler.free.fr/?q=jdgui"&gt;JD-GUI&lt;/a&gt; for byte code decompilation and easy viewing. Whilst &lt;code&gt;javap&lt;/code&gt; is fine for seeing the raw byte code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;5. Never throw Exceptions from an AST transform&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The Groovy compiler really doesn&amp;#8217;t like it if you throw an exception from an AST transform. It also results in ugly errors to the user of your transform.&lt;/p&gt;
&lt;p&gt;The proper way to report an error is via the &lt;code&gt;SourceUnit&lt;/code&gt; which has an &lt;code&gt;errorCollector&lt;/code&gt; property:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;&lt;code&gt; 
String messageText = "You can only negate a binary expressions in queries."
Token token = Token.newString(
                       expression.getText(),
                       expression.getLineNumber(), 
                       expression.getColumnNumber())
LocatedMessage message = new LocatedMessage(messageText, token, sourceUnit)
sourceUnit
   .getErrorCollector()
   .addError(message);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will properly report a compilation error to the user. Notice too how you can pass information about the current expression node (line number, column number etc.) so that the compiler reports the location of the error nicely to the user.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Example AST Transforms in Grails&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Finally, I thought I would list some of the AST transforms and what they do in Grails if you wish to see some examples in action:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="https://github.com/SpringSource/grails-data-mapping/blob/master/grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/query/transform/DetachedCriteriaTransformer.java"&gt;DetachedCriteriaTransformer&lt;/a&gt; - powers Grails 2.0&amp;#8217;s new &lt;a href="http://grails.org/doc/latest/guide/GORM.html#whereQueries"&gt;where queries&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/grails/grails-core/blob/master/grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/compiler/gorm/GormTransformer.java"&gt;GormTransformer&lt;/a&gt; - wires in all of the GORM methods into each domain class&amp;#8217; byte code&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/grails/grails-core/blob/master/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformer.java"&gt;ControllerActionTransformer&lt;/a&gt; - transforms controller methods so that request parameters get auto-bound to method arguments &lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/grails/grails-core/blob/master/grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerTransformer.java"&gt;ControllerTransformer&lt;/a&gt; - wires in the request, response, params etc. objects that form the controllers API&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/SpringSource/grails-data-mapping/blob/master/grails-datastore-gorm-jpa/src/main/groovy/org/grails/datastore/gorm/jpa/GormToJpaTransform.java"&gt;GormToJpaTransform&lt;/a&gt; - Transforms a GORM entity to a JPA annotated entity at the byte code level. Part of the new GORM-JPA plugin.&lt;/li&gt;
&lt;/ul&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</description><link>http://grails.io/post/15965611310</link><guid>http://grails.io/post/15965611310</guid><pubDate>Mon, 16 Jan 2012 21:59:00 +0100</pubDate><category>grails</category><category>groovy</category><category>ast</category><category>internals</category></item></channel></rss>
