GWT/Grails Tutorial - First Steps (Jan Ehrhardt)

, June 16th, 2008

Original Source

Jan Ehrhardt has written an introductory tutorial on Grails 1.0.3, GWT 1.4 and the GWT Plugin 0.2.4 . It covers the following topics:

  • installing the GWT Plugin
  • creating a basic domain class
  • creating a service to be exposed to the GWT Client
  • creating the GWT Client
  • running and packing the GWT Client

This is quite the interesting read, we are hoping more tutorials on this subject to be posted in the future.

Tags: ,

BGG – Beginning Groovy and Grails – June 23 (Jim Shingler)

, June 14th, 2008

Original Source

We recently commented on the next batch of Groovy/Grails related books to be released in the coming months. Jim Shingler has announced that June 23 is to be the shipping date of BGG - Beginning Groovy and Grails, the book he co-authored with Christopher Judd and Joseph Faisal Nusairat. He also posted the table of contents which follows

Chapter 1 - Introduction to Groovy
Chapter 2 – Groovy Basics
Chapter 3 – More Advanced Groovy
Chapter 4 – Introduction to Grails
Chapter 5 – Building the User Interface
Chapter 6 – Building Domains and Services
Chapter 7 – Security in Grails
Chapter 8 – Web 2.0 – Ajax and Friends
Chapter 9 – Web Services
Chapter 10 – Reporting
Chapter 11 – Batch Processing
Chapter 12 – Deploying and Upgrading
Chapter 13 – Alternative Clients

Tags: ,

Running Grails Applications on a VPS (Spencer Uresk)

, June 13th, 2008

Original Source

Spencer Uresk presents some tips for running Grails enabled applications in a VPS (Virtual Private Server). As you know Java based application hosting is not cheap compared to alternatives like PHP or even Rails, which is why many of such applications are hosted and maintained within the same organization that created them. Java friendly VPS offer an option for small to medium sized web applications to be run under a modest budget compared to what you would have to invest if doing it by yourself all alone.

For some time, it has been one of my dreams to see Java-based web applications be more viable for small websites. This means two things: rapid development capabilities (like Ruby on Rails), and inexpensive, reliable, and economical hosting options.

For goal #1, Grails is clearly fitting the bill. I spent the last year or so developing Rails apps, and Grails feels almost as productive. The community around it is getting quite active and there are some excellent plugins.

Reaching Goal #2 is going to be a bit trickier, but I think we are getting close. I am able to deploy 3 or 4 Grails applications on a 256 MB VPS now, and they work reasonably well. The good thing is that VPS’ are getting quite cheap, and a VPS with 256 MB of memory can easily be had for less than $20/month.

Spencer’s tips are

1. Dump Apache HTTP server

A lot of people would use Apache to forward requests to Tomcat. There is nothing wrong with Apache HTTP server itself, but in this setup, it can eat up a bunch of memory and really isn’t necessary. You can use iptables or xinetd to forward requests from port 80 to your app server. Doing this should free up a bit more precious memory for your app server.

2. Make sure you are using the server JVM

This is easy to forget to do - HotSpot will automatically choose which vm to run based on server attributes, so on a real production box, it will choose the server vm automatically. On a VPS, you’ll need to manually do this by adding “-server” to CATALINA_OPTS.

3. Give you server more PermGen space

Groovy uses a bit more PermGen space than normal, due to all the classloading it does. This means you’ll probably want to configure your vm to use a bit more PermGen space than usual by doing -XX:MaxPermSize=m. On my server, setting this to about half of the overall memory allocated seemed to be the best, but your results may vary.

4. Experiment

Ideally, you’d just upload your apps and not worry about tuning, but when you are trying to squeeze the most out of a VPS, this isn’t the case. Play around with different memory settings and other vm options to see what gets your particular setup the best performance and stability.

Tags: ,

Grails at LinkedIn (Brian Guan)

, June 12th, 2008

Original Source

It’s been more than 6 months since the Grails community learned that LinkedIn , an online network of professional contacts, has been using Grails along with custom made frameworks to power their applications. Brian’s post mentions the early days and why they chose Grails, it also links to the presentation slides of a talk they gave at JavaOne 2008

Back in late summer of 2007, we saw a business opportunity to build a LinkedIn web application on-top of our extensive database, and we needed to build one fast (3-4 months)! We started with an extremely small team of engineers (2-3) and eventually grew to 6 engineers. We needed a framework that could give us the productivity we needed, while allowing us to leverage the extensive assets we have invested in our backend logic built on top of Java and Spring. Given that most of us are Java engineers, we wanted something that had a shorter learning curve.

I’d been playing with Grails since 0.1 days, and I thought this would be a perfect opportunity to test drive this technology. I wanted to see if we could quickly realize the productivity gains in a real world scenario. My main worries were: scalability and compatibility with the LinkedIn technology and process ecosystem . Due to the fact that this is not a free product, our initial customer base has been small and will remain small for a quite some time. Because of this, we were able to de-prioritize the usual stringent scalability requirement to allow us to give this young framework a chance to prove itself.

Another engineer (who had no prior experience with Grails) and I built two initial prototypes: one based on AppFuse 2.0 M5 (Spring MVC/JSP + Hibernate), and one based on Grails 0.6 . We found that Grails was a lot faster to work with, even in its immature state. We then took a month to firm up the prototype and presented to management to gain their blessings to do it for real.

Tags: ,

Upcoming Grails Books

, June 12th, 2008

Glen Smith (from groovyblogs, Gravl & Grails podcast fame) has announced he is working on a Grails book along with Peter Ledbrook (G2One engineer and Grails core developer). It will be published by Manning in the popular "in Action" series. Here is the book’s outline in Glen’s words:

Quite a lot. Section One gives you the standard tour: a quickstart primer on Grails, a brushup on Groovy, and we throw together a quick and dirty sample so that Java programmers new to Grails can get a taste of some of the joys that await them.

Section Two we develop some rock solid basics on all the core sections of the technology (but even seasoned guys will probably want to dip into this section from time to time - for example to get up to speed on content negotiation practicalities, the legacy mapping DSL stuff, controller scoping and some other corner cases that you need to know when you need to know). Of course there is complete covering of testing and mocking and all that other agile-y stuff you’ll want to know about.

Section Three we roll into Web2.0 goodness. All the standards are in there: full text search, feeds, charting, reporting, and javascript hocus pocus. We also get into a good coverage of plugin development from the trenches with all the common scenarios you’re likely to run into. You’ll also learn the ins and outs of the Security plugins (Peter wrote the JSecurity plugin!), and get ideas on doing a Web2.0 makeover on your current apps. And you want your app to be a platform, right? So we’ll be giving first class coverage to REST architectures, and you’ll learn enough JSON to get yourself into trouble.

Section Four we get down and dirty with enterprise concerns. In here we fine a complete practitioners guide to deployment lifecycle issues (including per-environment strategies, monitoring and profiling), and probably the most complete coverage of enterprise stuff with Grails that you’re likely to come across (JMX, EJB3, JMS, JNDI and probably a little portlets by then). First class treatment of re-using Spring and Hibernate legacy mappings (along with re-using your current Java code) also should get a Guernsey.

Glen & Peter don’t have a definitive date for shipping yet but it is likely to happen in the first months of 2009.

Graeme Rocher also started a revised edition of The Definitive Guide to Grails from Apress, but this time he is not alone, Scott Davis (Groovy Recipes) has joined to bring you more content and tons of useful bits. This book is scheduled also for late 2008.

What I find really interesting about these two books is that both have a core developer and an avid user/evangelizer of the framework as authors. Given the current track of topics Scott and Glen have been presenting on their blogs and conference talks I trust we will see plenty of end user experience enhancements (AJAX, RIA, Flex), not just a thorough introduction to the framework.

Christopher M. Judd, Joseph Faisal Nusairat and Jim Shingler are also working on a Groovy/Grails book titled Beginning Groovy and Grails: From Novice to Professional , to be published by Apress. It should be available by the end of June.

Tags: ,

Ajax Development with the Yahoo! UI Library and Grails (Rich Web Experience)

, June 11th, 2008

Original Source

The Rich Web Experience has published a video, from a previous edition of the conference, where Scott Davis discusses integrating the Yahoo! UI Library and Grails to create a compelling user experience while remaining highly productive. Be aware that due to the nature of the presentation (multi-screen) some portions of the video do not display what Scott was showing at the moment.

You will have to follow the original link to actually see the video.

Please visit The Rich Web Experience website for more details on the conference, coming to both both sides of the Continental US this September.

About Scott Davis

Scott Davis Scott Davis is an internationally recognized author and speaker. He is passionate about open source solutions and agile development. He has worked on a variety of Java platforms, from J2EE to J2SE to J2ME (sometimes all on the same project).

Scott’s books include Groovy Recipes: Greasing the Wheels of Java , GIS for Web Developers: Adding Where to Your Web Applications , The Google Maps API , and JBoss At Work .

Scott is the Editor in Chief of aboutGroovy.com , a news and information website that tracks the latest developments in Groovy and Grails. He also writes a regular column for IBM DeveloperWorks — Mastering Grails .

Scott is a frequent presenter at national conferences (such as No Fluff, Just Stuff ) and local user groups. He was the president of the Denver Java Users Group in 2003 when it was voted one of the top-ten JUGs in North America. After a quick move north, he is currently active in the leadership of the Boulder Java Users Group . Keep up with him at http://www.davisworld.org .
More about Scott »

Tags: ,

Grails Podcast Episode 58: Newscast for June 9, 2008 (Sven Haiges & Glen Smith)

, June 9th, 2008

Original Source

Sadly, some audio was lost at the tail of this newscast, but there’s still plenty of content in here to enjoy.

Tags: ,

Grails 1.0.3 Released (Graeme Rocher)

, , June 6th, 2008

We’ve (G2One Inc and the Grails development team) just released Grails 1.0.3, which includes 230 issues resolutions and improvements since the last release. The release notes go through the full details, including outlining some of the new features like enum support and interactive mode.

Grails has come a long way, since the release of 1.0 Grails has been downloaded over 186000 times averaging out to around 50000 times per month. That puts it on par or not far behind some of the biggest open source projects like Spring, Hibernate and Struts in terms of downloads.

The most exciting thing for me though is the plug-in community with over 70 plug-ins in the repository some of the new ones include Axis 2 support, Java2D with GraphicsBuilder and profiling (contributed by one of the biggest Grails users LinkedIn) and debugging plug-ins. Awesome stuff.

Now I’m shifting my focus to the second edition of the book, and feature development for Grails 1.1.

- Graeme Rocher

Tags: , ,

Mixing Java, Groovy and Grails

June 6th, 2008

The following bit comes from Forever Precious, a multi-user collaborative wedding website service.

Grails, the groovy web framework has some really nice features - we feel GORM in particular leads to more rapid prototyping and cleaner code. However, at least as far as eclipse goes, raw Java is still much better supported than Groovy in terms of IDEs and refactoring (IDEA Groovy support is more advanced - but we use Eclipse here at foreverprecio.us). So we found ourselves in the position of wanting to use Java for a large portion of our code base, but also wanting to take advantage of the dynamic language capabilities of Groovy and the fantastic features of Grails.

We started with a plain vanilla Grails app, but rather than launch the application via ‘grails run-app’ or ‘grails deploy’ we created our own GrailsApplication instance and imported the precompiled classes from Grails. This provided us with a number of advantages. Groovy classes compile to plain old Java byte code, which means that precompiled Grails classes can be very easily referenced from Standard Java classes.

It is a well known fact that Grails follows the Convention over Configuration paradigm, but it surely is not (as Jason Rudolph puts it) Convention instead of Configuration. If you really need to tweak Grails in a way that is not provided by default you can certainly do it. Being able to create your own bootstrap sequence with a custom GrailsApplication class is a testament of that.

We started off rapidly prototyping most code in Groovy and Grails, then piece by piece ported the less dynamic portions to IDE refactorable Java. In a way the original Groovy and Grails code not only helped us get up and running quickly but also served as spec for the application. Grails code and Java code are malleable in different ways - Eclipse provides excellent refactorability for Java, but not yet for Groovy. However in a standard app, this is sometimes mitigated by the reams of XML (or even annotations) needed to configure the application. In Grails convention over configuration and the dynamic nature of Groovy provided malleability at a higher level than the refactorability of Java and served really well for rapid prototyping. Our Java / Groovy bridge - the Groovy Access Object and the syntactic similarities between the languages meant that we were able to reuse much when converting parts from Groovy to Java.

Another reason for Grails to be a good choice: rapid prototyping of a web application. You are free to reuse the prototype or mix in as much Java code as required. Groovy works as a glue through all of Grails’ artifacts and it surely gives you productivity gains, but if you need Java for an specific constraint (tool support is a valid one) then Grails will be happy to oblige, it will not force you to use Groovy as the sole language.

Tags:

Simplify Development with Groovy and Grails

, , June 6th, 2008

Simplify Development with Groovy and Grails

Groovy started in 2003 with the following goals:

  • To simplify the lives of developers
  • Seamlessly integrate with the Java platform
  • Be dynamic to open up possibilities

Groovy and Grails are Booming!

  • More than 5,000 Groovy downloads per month, peaking at 10,000 with a new release
  • Over 1,000 mailing list subscribers
  • Up to 1,000 messages per month on the list
  • After last years Groovy / Grails talks at JavaOne there were over 7,000 downloads in just one week!
Scott Davis

Scott Davis, author of Groovy Recipes says Groovy is “what the Java language would look like had it been written in the 21st century”. Statically-typed languages limit productivity and expressiveness. Dynamic languages and Web frameworks are changing application development dramatically. This is a major opportunity for application developers!

Scott Davis and the No Fluff Just Stuff Symposium series are offering 3 day intensive Mastering Groovy and Grails workshops . The next workshop is scheduled for Aug. 06 - 08, 2008 in Herndon, VA . If you can’t make it to Herndon, check out groovygrails.com we will be announcing more training dates soon. In addition, we will be hosting our second Groovy / Grails Experience (2GX) in September in San Jose, CA. Details will be posted later this summer.

More details can be found at the event site .

Tags: , ,