Jun
26
2008

How much should a Chapter 1 cover?

I’m putting the final touches on the “Chapter 1 Quickstart” for Grails in Action, and I think the trickiest part of a Chapter 1 is the pedagogy. Exactly how much should you cover? I’ve given this a bit of thought, and I’m convinced that most development books I read start too slow.

I’m just guessing, but the average readership of Grails in Action is probably (1) Java developers keen to explore what all the fuss is about; and (2) Groovy and Grails enthusiasts wanting an “in the trenches” book diving deep into the practical roadblocks they might face. I’m assuming (2) will be skipping the first few chapters, so we can probably skip them for Chapter 1. Which leaves us with all those Java developers. How fast is too fast?

Most Java developers that I know that buy books are pretty sharp. They’re keen to hone their craft, learn new skills, explore. So I figure that Chapter 1 should be a sip from a fire hose. Here’s a taste of the Chapter 1 QOTD application (still in need of some CSS tweaks):

The QOTD app from Chapter 1

So, what do you learn in chapter 1:

  • Getting your Grails environment setup
  • Starting your Application
  • Creating a controller to take user input
  • Using a view to format your quote
  • Skinning the view with a custom template
  • Simple DB operations (loading/saving quotes)
  • Scaffolding the admin pages
  • Refactoring your business logic into a Service
  • Writing a test case for your service
  • Ajaxing the quote replacement
  • Generating a WAR file for deployment

And it’s not a long chapter :-) . You basically get a taste of all the core features of Grails over 25 pages. Along the way you build a simple, deployable Quote Of The Day application. Not rocket science stuff, but a good taste to whet your appetite. I hope it’s not too much to take in for a “Chapter 1″, but this whole book is about hitting the ground running, so I hope developers appreciate the pragmatic “Leeroy Jenkins” approach.

But given this is my first book, this might all be just crazy talk… If you have a favourite “Chapter 1″ style, let me know. We’ll see what survives editorial…

About the Author: Glen Smith

8 Comments + Add Comment

  • I like the approach you’re suggesting … as a technologist what I want from Chapter 1 is to understand the technology, not through flowery dissertations, but by using an example to map it to concepts and knowledge I already know (e.g., where does it fit, how does it interact with other tiers and layers, overview of request/response modelling if appropriate).

    Across the whole book I’m looking for coverage of not only capabilities and functionality, but also something of what’s happening under the covers. While some people I work with are great deployers of off-the-shelf frameworks, libraries and languages, I’m pretty reluctant to use something unless I know and trust how it’s handling threading, transactions, scope, security, class loading, etc. If the documentation doesn’t cover a topic that I want to know about, I can’t help but think the coder may not have cognisant of the issue and alarm bells ring. I subsequently spend time trawling through source code, or just write some application-specific code myself.

  • ** Grails in __Action__ ** indeed. Nicely done!

    And kudos on the “Leeroy Jenkins” reference. ;-)

  • I think this approach is a good one for the first chapter. Having said that, I think a book about a framework should also cover the design philosophies the drive the development of the framework itself as well as the design philosophies most appropriate for usage of this framework.

    Some authors use the first chapter for this kind of stuff. Though I personally think this should be put into chapter two or three while chapter one should be a quick-dive into the technology with some hands-on approach. Chapter one should whet the appetite!

  • Glen,

    First of all, Congratulations for starting this Action series book on Grails. The Java/Grails community deserves a detailed action series book like this.

    The idea of “giving a taste of Grails through building a simple application rapidly in Chapter-1″ is very good.

    In my opinion, it would be nice if a brief coverage of the following points elaborated upfront in Chapter -1 (a page or two) before diving into quick practical introduction to grails through an example application:
    • The ever increasing complexity of Java/EE development, even with frameworks liks HIBERNATE, Spring etc. trying to solve this complexity. How grails solves this complexity with simple principles CoC, DRY and Boiler Plate Code generation.
    • How grails uniquely stands in the much crowded Java Web frameworks.
    • Its unique strengths.
    • Groovy the power language behind this framework.
    • The benefits it brings to entire SDLC and how joyful it makes the development.
    • It is also worth mentioning RubyOnRails from which much of the framework ideas are taken and what grails does it differently from RoR (e.g. Domain centric vs. database centric).

  • Sounds good as long as there will be more than two chapters. Keep to the point and don’t over embellish on information that’s generally available online. I’ve been on a Grails sabbatical for the last few months so I’m itchin’ to be back to class!

  • I am looking forward to your book. You know I like chapter one’s to be kinda concise. Give me enough to want to drink the kool aid and read the rest of your book.

  • Congratulations from Brasil !!!

  • Glen, your book comes at a very good time for me. I’m pretty much new to Grails and I would be happy to provide a newbie’s perspective on the book. Happy to learn Grails the Glen Smith way…

Leave a comment

Glen Smith

About Glen

Co-author Grails in Action