<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BarneyBlog &#187; grails</title>
	<atom:link href="http://www.barneyb.com/barneyblog/category/grails/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.barneyb.com/barneyblog</link>
	<description>Thoughts, rants, and even some code from the mind of Barney Boisvert.</description>
	<lastBuildDate>Mon, 02 Mar 2020 13:20:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CFUNITED Day One</title>
		<link>https://www.barneyb.com/barneyblog/2008/06/19/cfunited-day-one/</link>
		<comments>https://www.barneyb.com/barneyblog/2008/06/19/cfunited-day-one/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 13:04:16 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[bluedragon]]></category>
		<category><![CDATA[cfml]]></category>
		<category><![CDATA[coldfusion]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[personal]]></category>
		<category><![CDATA[railo]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/?p=426</guid>
		<description><![CDATA[As is typically the case, CFUNITED has a pair of themes.Â  There's the conference theme, which, as always, is helping CF coders become more empowered by learning about new things (OO, using CFCs, learning frameworks, etc.), and then there's the "backtheme".Â  This year it's all don't use only CF.Â  Adobe's integrating Hibernate into CF9, Railo [...]]]></description>
			<content:encoded><![CDATA[<p>As is typically the case, CFUNITED has a pair of themes.Â  There's the conference theme, which, as always, is helping CF coders become more empowered by learning about new things (OO, using CFCs, learning frameworks, etc.), and then there's the "backtheme".Â  This year it's all don't use only CF.Â  Adobe's integrating Hibernate into CF9, Railo is preaching the benefits of the JBoss platform (clustering, caching, Hibernate, etc.), Groovy has a lot of lovers, and Grails (which is Spring and Hibernate for Groovy) does to.</p>
<p>The integration of Hibernate all over the place is very exciting.Â  CF-based ORM tools suck, frankly.Â  Which isn't to belittle <a href="http://www.transfer-orm.com/">Mark</a> or <a href="http://www.alagad.com/go/products-and-projects/reactor-for-coldfusion">Doug</a> in any way, they've done a fantastic job, it's problems with CF itself that are the issue.Â  With Railo's "CFC is a class" implementation, Hibernate is directly applicable.Â  With CF's crazy "a CFC is a bunch of classes in a Map" implementation, I'm not sure how Adobe's going to get it to work.Â  I'm very much hoping they fix the core issue (which would almost certainly give some nice performance benefits as well) instead of bastardizing Hibernate to get it to work, but we'll see.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2008/06/19/cfunited-day-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barney and the Holy Grail</title>
		<link>https://www.barneyb.com/barneyblog/2008/02/11/barney-and-the-holy-grail/</link>
		<comments>https://www.barneyb.com/barneyblog/2008/02/11/barney-and-the-holy-grail/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 07:11:12 +0000</pubDate>
		<dc:creator>barneyb</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[grails]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.barneyb.com/barneyblog/2008/02/11/barney-and-the-holy-grail/</guid>
		<description><![CDATA[Yes, I know it's Lent, but I'm not talking about that Grail &#8211;  I'm talking about Grails, the web framework for Groovy (the dynamic layer for Java).
I've been looking for a way to ditch CFML for a while now, but nothing has really hit the mark.  I keep hoping that Adobe is going [...]]]></description>
			<content:encoded><![CDATA[<p>Yes, I know it's Lent, but I'm not talking about that Grail &#8211;  I'm talking about Grails, the web framework for Groovy (the dynamic layer for Java).</p>
<p>I've been looking for a way to ditch CFML for a while now, but nothing has really hit the mark.  I keep hoping that Adobe is going to release CF8.1 with Flex 3 and allow all your server-side scripting to be in ActionScript 3, but I'm not holding my breath.  The CF platform is pretty nice (excepting the massive bloat), but the CFML language itself just blows ass.  So I shop&#8230;</p>
<p>I liked SpringMVC/Spring/Hibernate when I was using it, but it's definitely enterprise-y.  I've looked at Rails, but I really dislike Ruby's syntax, and ActiveRecord leaves something to be desired (like a query language).  Django and Pylons (for Python) are slick seeming, but Python's whitespace-is-semantic paradigm is a big turnoff.  My CFRhino "project" actually has some promise, I think, but not something I want to get into maintaining for real application development, and it's JavaScript, which means no real classes and classloading (among other things).</p>
<p>Enter Grails.  Like it's counterparts in other languages, it's all about speed of development, but unlike the others, it's all Java.  It's built on Hibernate, Spring, and SpringMVC.  It compiles to bytecode.  It seamlessly integrates with existing Java apps and tools (Quartz, Acegi, DWR, etc.).  The paradigms it leverages were incredibly easy to jump into (granted, I've used it's backing tools before), and within a couple hours of seeing both Grails and Groovy for the first time, I had a quasi-functional blog platform.</p>
<p>The past week of developing a first "real" app has borne out my initial impressions to the nth degree.  Groovy is a really slick layer that augments Java in just the right ways, without getting the way.  Closure are a big deal, vastly superior to simple functions or Java's inner classes.  You also get dynamic methods, iterators, native regular expressions, multi-line strings, ranges, a ternary operator (c'mon CF, it's not the 60's), the "elvis" operator which is the ternary operator with the middle clause omitted and the first clause used as it's value, and null-safe dot operator.</p>
<p>But Grails is where it's at.</p>
<pre>class User {
  String username
  String password
  String email

  static constraints = {
    username(blank: false, unique: true, size: 4..16)
    password(blank: false, password: true, size: 4..32)
    email(email: true, blank: false)
  }
}</pre>
<p>That whopping 11 lines of code is sufficient to create a domain entity with three fields, create validation for the fields, create a Hibernate mapping, and set up all the SpringMVC goodies for binding, form generation/population, error messages, etc.</p>
<p>Request processing, you ask?  You have a collection of controllers (think circuits, if you know <a href="http://www.fuseboxframework.org/">Fusebox</a>), each of which is a collection of actions (i.e. named closures) corresponding to requests (think fuseactions).  So the URL "/login/doLogout" would map to the "doLogout" closure of the "login" controller.  Each action closer can redirect, render directly, or return an arbitrary data structre to be passed to a view.  By default, the view is a file named to match the action, in a folder to match the controller (you can override, of course), which is written in Groovy Server Pages (GSP).  Think JSP, except without the heavy dose of suck.  For example, you can define taglibs using Groovy, and then use them in both your views and your controllers, as either tags or as functions.</p>
<p>Grails (thanks to Spring) also provides all-encompassing dependency injection for not only your services and controllers, but for your domain objects as well, which is fantastic.  That was one of the larger problems I had with using Spring and Hibernate directly, and one that I never was able to solve in a very satisfactory way.  It also provides controller filters which are exceptionally handy (enforcing logins, adding model data for your layouts, etc.).</p>
<p>And the last big piece is SiteMesh, which is the [optional] layout toolkit.  You can certainly use GSP for everything; simply include your header/footer as needed and go.  But SiteMesh provides basic page wrapping functionality to ease the task, along with a very powerful content dissection/assembly framework (think Fusebox's contentvariables, except managed by the view as they should be).</p>
<p>Finally, yes, there is pretty comprehensive scaffolding support.  It doesn't blow my skirt up as much as the other stuff though, but that's probably more a reflection on the type of apps I'm usually building rather than the general utility of the feature.</p>
<p>In case you can't tell, I'm impressed.  The Grails guys have done a fantastic job at taking some incredibly flexible and powerful tools and making them ridiculously easy to use.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.barneyb.com/barneyblog/2008/02/11/barney-and-the-holy-grail/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
