puts Blog.new(”nonsense”)

Video: Grails Presentation at QCon San Francisco

Posted by Jason Rudolph on 20th May 2008

InfoQ recently posted the video of my presentation on Grails from QCon San Francisco. If 50 slides in 50 minutes sounds a tad formulaic and tired to you, then you’re in luck. Instead, you’ll see 50 slides in about 5 minutes, followed immediately by 50 minutes of no-nonsense live coding goodness.

QCon Logo

In what could perhaps be described as a series of 12 back-to-back lightning talks, you can see what it takes to go from a blank slate to a deployable Grails app including…

  • defining domain classes,
  • setting up relationships,
  • hooking up a database,
  • establishing constraints and validation error messages,
  • enjoying sexy dynamic finders,
  • applying custom URL mappings,
  • working with tag libraries,
  • encapsulating business logic in services,
  • integrating with existing Java code,
  • sending e-mail,
  • finding and installing plugins, and
  • locking down the app with secure authentication and authorization

There’s some good Q & A in there as well. Unfortunately not all of the questions came through on the audio, but in most cases you can pick up the context from the reply.

You’ll also hear me reference Charles Nutter’s JRuby talk a few times over the course of the presentation, and I recommend checking out that video as well.

Tags: , , , , , | No Comments »

Interview at Groovy Zone

Posted by Jason Rudolph on 3rd April 2008

Andres Almiray interviewed me this week for the Groovy Zone. We cover a breadth of topics, including:

  • Just how far Grails has come in the past two years
  • Why the GORM DSL likely obviates previous mapping techniques
  • Groovy as a gateway drug to more and better developer testing
  • Why Grails testing infrastructure improvements deserve top billing in Grails 1.1
  • Something called Rails
  • New testing-related developments in the Groovy ecosystem

For all that and more, check out the interview at Groovy Zone, a new(ish) and hoppin’ community for Groovy and Grails news.

20080404 DZone Logo

(Did I mention that we discuss testing?)

Many thanks to Andres and DZone for the interview.

Tags: , , , , , , | 2 Comments »

Getting Started with Grails: The Jasper Reports “Expansion Pack”

Posted by Jason Rudolph on 2nd April 2008

Marcos Fábio Pereira has just published a step-by-step guide for using the slick JasperGrails plugin in the Racetrack application (originally developed in Getting Started with Grails). The tutorial includes examples of generating a PDF of all the races in the app, exporting an Excel spreadsheet listing all the registrations for a race, and the impressively concise bits of code necessary to get this new tastiness up and running.

Jasper Reports Logo

Nicely done, Marcos!

Tags: , | 4 Comments »

Getting Started with Grails: The Acegi “Expansion Pack”

Posted by Jason Rudolph on 26th February 2008

InfoQ recently published a step-by-step tutorial for quickly installing and configuring the Grails Acegi plugin into the Racetrack application (originally developed in Getting Started with Grails). Kudos to Fadi Shami for assembling this handy guide.

20080226 Grails + Acegi

You can find out more about the Grails Acegi plugin and the rest of the fast-growing plugin ecosystem at the official Grails plugin site.

Tags: , | No Comments »

GSwG Source Code Now Updated for Grails 0.5

Posted by Jason Rudolph on 19th May 2007

Grails 0.5 was a huge release, and you’re bound to come across some of its many enhancements in any app you build. If you’ve installed 0.5 and you’re using it as you work through Getting Started with Grails (GSwG), there are a few new resources to assist you in that endeavor.

First up, you’ll want to grab the updated sample code for the RaceTrack application. If you’re building the application with Grails 0.5, you can now compare your progress to this sample code at any time to see exactly how the application should look at the end of each chapter.

Next, take a few minutes to have a look at the updated FAQ. The FAQ is your one-stop shop for any and all changes since the book’s original release circa Grails 0.3.1. It’s there that you’ll find answers to these questions and others…

  • Using Grails 0.5, I don’t see the index.jsp file that’s supposed to reside in racetrack/web-app/WEB-INF. Did you mean to say index.gsp instead?

  • When I run the application using Grails 0.5, I see deprecation warnings related to the optionals attribute defined in Registration.groovy. What gives?

  • Using Grails 0.4 (or higher), I can’t seem to find the log4j.production.properties that’s supposed to be in racetrack/web-app/WEB-INF. Where did it go?

  • Using Grails 0.5, why does Grails name my WAR racetrack-0.1.war instead of racetrack.war?

I hope you find these resources helpful. And, if you run into gotchas or you have any questions, please feel free to drop me a line.

Enjoy.

Tags: , | No Comments »

Getting *Updated* with Grails - Updated Source Code Available for Grails 0.4.2

Posted by Jason Rudolph on 13th March 2007

As you might have heard, Grails is on a roll. And with the recent release of Grails 0.4.2, it's time for some updated source code to accompany Getting Started with Grails. You won't find any drastic changes in the RaceTrack code, but for those working through the book with Grails 0.4.2, you may find comfort in knowing that the code you're developing as you work through the book should exactly match the updated sample code. In addition to the source code, I've also published a short (thankfully) errata page and FAQ. If you notice any glitches or have any questions, please feel free to drop me a line. Enjoy.

Tags: , | No Comments »

Podcast Interview with aboutGroovy.com

Posted by Jason Rudolph on 14th February 2007

I recently had the chance to sit down with Scott Davis, Editor in Chief of aboutGroovy.com, for an interview about Grails, how I got involved with it, and what lies ahead.  It runs about 23 minutes in length, but we manage to cover quite a bit in that time frame.  We agree that we don't need one programming language/technology "to rule them all."  We discuss the origin of (and the potential future for) Getting Started with Grails, and we set the record straight on whether EJB3 is a legacy technology.  (Spoiler alert: It's not.)

Proper RSS support is coming soon for aboutGroovy.com podcasts.  In the meantime, feel free to download the MP3 directly.  

Many thanks to Scott and aboutGroovy.com for the interview. 

Tags: , , , , , | No Comments »

Just Released: Getting Started with Grails

Posted by Jason Rudolph on 17th January 2007

InfoQ has just released my new book, Getting Started with Grails, and it's available as a free download for you to digg into and find out what Grails is all about.  The book walks you through building a Grails app from scratch, and introduces various Grails features over the course of several iterative development cycles.  So, download the book, grab the sample code, and enjoy!

It was a sincere pleasure to work with the many talented reviewers that helped out on this book.  I hope you find this book helpful, and please feel free drop me a line with any feedback or post a comment below.  Groove on!


Tags: , , | 4 Comments »

Out of the Box Grails + JEE Integration

Posted by Jason Rudolph on 18th December 2006

There's something to be said for things that just work right out of the box, and JEE integration with Grails falls nicely into that category.  When people first hear about Grails and they see demonstrations of its rapid application development (RAD) capabilities, it’s not long before an air of skepticism seems to set in.  Surely a framework offering this level of productivity can’t possibly play nicely with a corporation’s highly-configurable and often complex application servers.  Of course, this isn’t a new topic, as we've certainly explored some of these areas before.  Nevertheless, questions remain, and any new technology has to prove its worth.  

One rather common question concerns the ability to hook into an app server’s data sources using JNDI.  If you've invested in a JEE container, there's a good chance you want to make use of its database connection pooling.  (For that matter, it's probably a company policy to do so.)  And, needless to say, beyond just connection pooling, using data sources also offers the added security and maintenance benefits of not packaging your database user ID, password, and URL inside your application.

So, what does it take to get a Grails app to obtain its database connections from a container-managed data source?  Assuming you have your data source configured in your app server, it’s as simple as telling Grails how to look it up.  Let’s first take a look at the data source definition in the app server.  For this example, we’ll look at a MySQL data source configured in JBoss Application Server.

projects> cat /Applications/jboss-4.0.5.GA/server/default/deploy/mysql-ds.xml
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
    <local-tx-datasource>
        <jndi-name>
jdbc/racetrack</jndi-name>
        <connection-url>jdbc:mysql://localhost/racetrackprod</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <user-name>prod</user-name>
        <password>wahoowa</password>
        <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
        <metadata>
            <type-mapping>mySQL</type-mapping>
        </metadata>
    </local-tx-datasource>
</datasources>

Once we know the JNDI name for the data source – in this case, we see from the output above that it’s jdbc/racetrack – we simply define a Spring bean for that data source in $PROJECT
HOME/spring/resources.xml (where $PROJECT_HOME is the root directory of your Grails application).

projects> cat racetrack/spring/resources.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
    <bean id="dataSource"
        class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="
java:jdbc/racetrack"/>
    </bean>
</beans>

Then, just run grails war to create the WAR, and that’s it.  Now, when you deploy the WAR to your app server, your Grails application will use your container-managed data source for all of its database access.

So, what other types of JEE integration would you look for in your Grails apps?  (Sound off in the comments, and perhaps we’ll have additional posts on this topic.)  If you found this particular example to be a bit trivial, great!  That’s exactly the point.  JEE integration doesn’t have to be painful, at least not with Grails.  

Resources 

  • JBoss configuration file for MySQL data source - mysql-ds.xml
  • Spring configuration file - resources.xml
  • The rest of this mysterious racetrack sample application - Coming soon!

Tags: , , | 2 Comments »

Podcast Interview: Grails 0.3 Release, Upcoming Book, and More

Posted by Jason Rudolph on 17th November 2006

I recently had the opportunity to chat with Sven Haiges for an episode of the Grails podcast. We discussed the many new features (and impressive number of bug fixes) in the recent 0.3 release as well as several of the upcoming improvements slated for 0.4 and 0.5. We also talked about the overall increasing momentum of Grails, and Sven recapped last week's W-JAX 2006 conference, which attracted standing-room-only crowds for the Groovy and Grails sessions! It was a good time, and if you listen closely, you might even catch an announcement of an upcoming Grails-related publication.

Many thanks to Sven for having me on the podcast.

Subscribe to the podcast in iTunes

Tags: , , , | No Comments »