A collection of specimens: Groovy on Grails
10 Common Misconceptions about Grails
As is usually the case with anything "new" there’s a lot of FUD and confusion out there with people who have not used Grails yet, that may be stopping them using it. Here’s a quick list of some of the more common falsehoods being bandied about:
"Grails is just a clone of Rails". Ruby On Rails introduced and unified some great ideas. Grails applies some of them to the Groovy/Java world but adds many features and concepts that don’t exist in Ruby, all in a way that makes sense to Groovy/Java programmers.
"Grails is not mature enough for me". The increasing number of live commercial sites is the best answer to that. Its also built on Hibernate, Spring and SiteMesh which are well-established technologies, not to mention the Java JDK which is as old as the hills. Groovy is over three years old.
"Grails uses an interpreted language (Groovy)". Groovy compiles to Java VM bytecode at runtime. It is never, ever, ever interpreted. Period. Never. Did I say never ever? Really.
"Grails needs its own runtime environment". Nope, you produce good old WAR files with "grails war" and deploy on your favourite app container. During development Grails uses the bundled Jetty just so you have zero configuration and dynamic reloading without container restarts.
"My manager won’t let me use Grails because it isn’t Java". Smack him/her upside the head then!** Grails code is approximately 85% Java. It runs on the Java VM. It runs in your existing servlet container. Groovy is the greatest complement to Java, and many times more productive. You can also write POJOs for persistence to databases in Java and include Java src and any JARs you like in a Grails application, including EJBs, Spring beans etc. Any new tech can be a hard sell in a cold grey institution, but there’s rarely a more convincing argument than "Hey Jim, I knocked up our new application prototype in 1hr in my lunch break with Grails - here’s the URL". [** comedy violence kids, not the real kind]
"Grails is only for CRUD applications". Many demos focus on CRUD scaffolding, but that is purely because of the instant gratification factor. Grails is an all purpose web framework.
"Scaffolding needs to be regenerated after every change". Scaffolding is what we call the automatically generated boilerplate controller and view code for CRUD operations. Explicit regeneration is never required unless you are not using dynamic scaffolding. "def scaffold = Classname" is all you need in a controller and Grails will magic everything else and handle reloads during development. You can then, if you want, generate the controller and view code prior to release for full customisation.
"Grails is like other frameworks, ultimately limiting". All Grails applications have a Spring bean context to which you can add absolutely any Java beans you like and access them from your application. Grails also has a sophisticated plugin architecture, and eminently flexible custom taglibs that are a refreshing change from JSP taglib.
"I can’t find Grails programmers". Any Java developer is easily a Grails developer. Plus there are far fewer lines of code in a Grails application than a standard Java web application, so getting up to speed will be much quicker.
"Grails will make you popular with women". Sorry quite the opposite, you will be enjoying coding so much you won’t be chasing any women for a while. We should put this as a warning in the README actually, along with a disclaimer about any potential divorce that might result from hours spent playing with your Grails webapps.
Why not come and hear other people talk non-FUD about how they are building web applications in double quick time at Grails Exchange 2007, tickets available now.
[from:http://www.anyware.co.uk/2005/2007/07/02/10-common-misconceptions-about-grails/]
Slides for my Grails Exchange 2007 talk
January 31st, 2008
So I talked at Grails Exchange 2007 about how we used Grails 0.4 through 0.5.6 to deploy five commercial branded websites in 2007.Skills Matter asked for all the slides up front, like most conferences do, but I "refused" because if you are doing a presentation that is not death by powerpoint, printed/pre-available material ruins the experience and stops people paying attention.
Finally I have put the slides into a PDF (24MB) so they can be viewed alongside watching the video of the talk. There’s also an HTML version here so you don’t need to download it all first. The video of the talk rarely includes the slides so following it is a bit of a tricky endeavor. Please note that these slides are not complete because the "Render slide for every stage of build" option in Keynote doesn’t do what it says. It doesn’t render build items that are part of smart builds… so when you get to the "Build scripts" slide, you have to imagine the other text coming up one by one: Bean/Spring configuration, ORM mapping, deployment descriptor, log configuration, test database, servlet container, and then "bang". I’m new to presenting and it shows, but I had a good time doing it. I’m a big fan of Presentation Zen and I really dislike bullet point presentations. The Presentation Zen book rocks - I only wish it was out before I did my talk! Your talks will be changed forever for the better if you buy it and read it. Garr Reynolds, the author, has a great blog.
However people laughed at the right points which were good fun circa slides 14-16. You end up with a lot more slides with this kind of approach, and its hard work to put it together, but its more fun.
It is hard to apply these principles to the "this is how you code it" part of technical talks… I’ll continue experimenting with it. I find large chunks of code in presentations hard to follow, and quite boring frankly. I’m more impressed by the results of the code and a little info about how, for the rest I’ll use docs / a book.
Thanks for everyone who came to my talk at the end of the day back in October - like I said on the day it wasn’t exactly going to tax people mentally, a bit of light entertainment Grails propaganda. Sorry it took so long to get the slides up, but you’ll see why I had to wait for the video to be live before I did it.
[from: http://www.anyware.co.uk/2005/]
Groovy On Rails is not accepted by Ruby On Rails creator
Today Graeme Rocher - project lead of Grails - received a mail from David Heinemeier Hansson - creator and project lead of Ruby on Rails to congratulate us with the first release of Grails and to ask us to not use the name Groovy On Rails.
We've decided - as a team - to no longer use the Groovy On Rails name but I have some questions about this request that I would like to see answered. For me the demand is a over the top, especially since the name "Ruby On Rails" is not protected by a trademark. I can understand the Ruby On Rails people want to protect their brand but they should really choose the correct legal ways to accomplish this instead of alienating people.
Again, we made this decision as a team and valued a good relationship with the Ruby On Rails community over a flame war which is also my personal choice. See the message on the Grails mailing list to announce the official name change.
[from: http://www.jroller.com/sdevijver/]
Rejoice! Grails 1.0 is here
February 5th, 2008
Now, if you can reach the Grails website you will be able to download Grails Version 1.0, which has finally "gone gold" and has brought the Codehaus server to its knees already it seems! Give the Codehaus guys some time to rig up something that will oil the wheels a bit, as there’s a definite overload situation going on with the site.
Most people understand that psychologically a 1.0 release is important. It sets the baseline and foundation for what is to come in the future. Grails 1.0 is incredibly rich in terms of core features, and has a growing list of free plugins that add all manner of powerful functionality.
Grails 1.0 has a powerful ORM DSL now for tweaking what Hibernate does behind the scenes in an intuitive way, including index generation. We’ve also now got Hibernate’s second-level caching in there. Not to mention the frankly pretty twisted auto unmarshalling of JSON/xml request payloads into beans, and the withFormat content negotiation stuff.
We have also put together a framework for automatically running functional web tests on "specimen" applications held in SVN as part of the Grails continuous integration builds. There are some teething troubles with the server environment but the whole process is working locally, and we just need to fill SVN with some good test apps with, more importantly, some comprehensive webtest scripts.
This will effectively form a kind of "TCK" for Grails and will ensure stability against the 1.0 baseline functionality - in addition to the large number of unit tests that Grails undergoes constantly as part of the continuous integration build platform (the rather excellent Bamboo as it happens). Contributions of non-trivial applications with comprehensive unit and webtests would be appreciated.
This is in addition to the work Graeme did to tie together Groovy SVN HEAD and Grails SVN HEAD in continuous integration to ensure that we spot any changes to Groovy that break Grails as early as possible, as well as giving the Groovy team a great stock of code to run their changes against.
We’re looking forward to talking to all the new Grails users that this 1.0 release will bring!
[from: http://www.anyware.co.uk/2005/]
Your way to Groovy
One main factor in the upward trend of animal life has been the power of wandering.
—Alfred North Whitehead
Welcome to the world of Groovy.
You’ve heard of Groovy on blogs and mailing lists. Maybe you’ve seen a snippet here and there. Perhaps a colleague has pointed out a page of your code and claimed the same work could be done in just a few lines of Groovy. Maybe you only picked up this book because the name is catchy. Why should you learn Groovy? What payback can you expect?
Groovy will give you some quick wins, whether it’s by making your Java code simpler to write, by automating recurring tasks, or by supporting ad-hoc scripting for your daily work as a programmer. It will give you longer-term wins by making your code simpler to read. Perhaps most important, it’s fun to use.
Learning Groovy is a wise investment. Groovy brings the power of advanced language features such as closures, dynamic typing, and the meta object protocol to the Java platform. Your Java knowledge will not become obsolete by walking the Groovy path. Groovy will build on your existing experience and familiarity with the Java platform, allowing you to pick and choose when you use which tool—and when to combine the two seamlessly.
If you have ever marveled at the Ruby folks who can implement a full-blown web application in the afternoon, the Python guys juggling collections, the Perl hackers managing a server farm with a few keystrokes, or Lisp gurus turning their whole codebase upside-down with a tiny change, then think about the language features they have at their disposal. The goal of Groovy is to provide language capabilities of comparable impact on the Java platform, while obeying the Java object model and keeping the perspective of a Java programmer.
This first chapter provides background information about Groovy and everything you need to know to get started. It starts with the Groovy story: why Groovy was created, what considerations drive its design, and how it positions itself in the landscape of languages and technologies. The next section expands on Groovy’s merits and how they can make life easier for you, whether you’re a Java programmer, a script aficionado, or an agile developer.
We strongly believe that there is only one way to learn a programming language: by trying it. We present a variety of scripts to demonstrate the compiler, interpreter, and shells, before listing some plug-ins available for widely used IDEs and where to find the latest information about Groovy.
By the end of this chapter, you will have a basic understanding of what Groovy is and how you can experiment with it.
We-the authors, the reviewers, and the editing team—wish you a great time programming Groovy and using this book for guidance and reference.
At GroovyOne 2004—a gathering of Groovy developers in London—James Strachan gave a keynote address telling the story of how he arrived at the idea of inventing Groovy.
Some time ago, he and his wife were waiting for a late plane. While she went shopping, he visited an Internet café and spontaneously decided to go to the Python web site and study the language. In the course of this activity, he became more and more intrigued. Being a seasoned Java programmer, he recognized that his home language lacked many of the interesting and useful features Python had invented, such as native language support for common datatypes in an expressive syntax and, more important, dynamic behavior. The idea was born to bring such features to Java.
This led to the main principles that guide Groovy’s development: to be a feature rich and Java friendly language, bringing the attractive benefits of dynamic languages to a robust and well-supported platform.
We don’t want to offend anyone by specifying exactly where we believe any particular other language might fit in the figure, but we’re confident of Groovy’s position.
Some languages may have a few more features than Groovy. Some languages may claim to integrate better with Java. None can currently touch Groovy when you consider both aspects together: Nothing provides a better combination of Java friendliness and a complete range of modern language features.
Knowing some of the aims of Groovy, let’s look at what it is.
[from: Groovy In Action by Dierk Konig]
2GX: Keynote - The Amazing Growth of Grails
So, I'm back from the 2GX - The Groovy/Grails Experience which was yet another event, brilliantly put together by Jay Zimmerman and the No Fluff crew. The good news is, if you missed out there is another one in the fall/autumn months in San Jose, CA.
The attendance was excellent for such a focused conference with close to 200 people in total all buzzing about Groovy & Grails. I delivered my "State of Grails" keynote on the Thursday evening which went into some analysis of where we are since the release of Grails 1.0 from a growth perspective, but also from a technology perspective.
I wasn't planning to, but a few people at the conference asked me to post my slides to help persuade managers etc. of the viability of Grails, not just from a technical perspective, but from a growth and community perspective. So if you're in the same position, check out my slides, the following is a summary of the contents.
When we released Grails 1.0, Codehaus' bandwith usage went up by a staggering 40gb. The downloads have been in the 10s of thousands since the release and luckily Contegix, the kind folks who host Codehaus, have freed up some extra bandwith for the servers.
The mailing list traffic on the Grails user mailing list has gone through the roof, averaging close to 140 messages a day in January and looking the same for Feb:
The traffic is contributing to make Grails one of the most vibrant communities around anyone one Java web framework according to Nabble:
Further evidence of the growing community is the Grails plug-in eco-system where Grails now has no less than 47 user contributed plug-ins in the plug-in repository representing nearly 2 million lines of user contributed code:
Blog traffic is also on the up, a year ago the blog traffic for Grails was merely a blip on the horizon (all probably posted by me ;-). Now according to technorati people are talking about Grails, a lot:
Clearly, we still have a long way to go to make Grails as hugely popular as things like Spring and Hibernate, but we're heading in the right direction which is great news.
[from: http://graemerocher.blogspot.com/]
Large commercial Grails site goes live
Sky (commercially known as BSkyB), who are the biggest satellite broadcaster in the UK and largely owned by News Corporation (Rupert Murdoch et al), have re-launched their Sky showbiz news portal, powered by Grails.
The site was put together by energized work, a consulting firm in the UK, well done guys!
This represents one of the largest, commercial public facing Grails applications (that we at G2One Inc are able to talk about at least ;-) out there at the moment with traffic in the region of 186 million page views a month. Its great to see so many huge companies taking the leap to Grails, long may it continue!
[from: http://graemerocher.blogspot.com/]
相关推荐
### Groovy和Grails配置方法 #### 一、Groovy与Grails简介 Groovy是一种强大的面向对象编程语言,它运行在Java平台上,并且能够直接与Java代码进行交互。Groovy支持函数式编程特性,拥有丰富的语法糖以及简洁的...
[Apress] Groovy, Grails, Griffon 入门教程 (英文版) [Apress] Beginning Groovy, Grails and Griffon (E-Book) ☆ 出版信息:☆ [作者信息] Vishal Layka, Christopher M. Judd, Joseph Faisal Nusairat, Jim ...
groovy-grails-tool-suite-3.6.4.RELEASE-e4.4.2-win32-x86_64.part1 共两个压缩包,解压后将扩展名.zip.bak改为.zip再次解压。
Groovy和Grails是两个密切相关的开源技术,主要用于构建现代、高效的Java平台应用程序。Groovy是一种动态、灵活的编程语言,它与Java高度兼容,但语法更为简洁,提供了更多的灵活性。而Grails则是一个基于Groovy的...
Eclipse 插件 Grails(Groovy)是一个强大的开发工具,它使得在Eclipse环境中进行Groovy和Grails应用的开发变得更为便捷。Groovy是一种动态、面向对象的编程语言,而Grails则是一个基于Groovy的开源Web应用框架,...
《初学者指南:Groovy与Grails》一书由Christopher M. Judd、Joseph Faisal Nusairat和James Shingler共同编写,是专为Java开发者设计的实用教程,旨在帮助他们掌握敏捷Web开发所需的Groovy和Grails技能。本书从入门...
根据提供的文件信息,我们可以从《Groovy and Grails Recipes》一书中提炼出多个与Groovy语言及Grails框架相关的知识点。下面将详细阐述这些知识点。 ### Groovy编程语言 **1. Groovy简介** - **定义**:Groovy是...
### 关于《从新手到专家:Groovy与Grails入门》 #### 一、书籍概述 本书《Beginning Groovy and Grails, From Novice to Professional》由Christopher M. Judd、Joseph Faisal Nusairat 和 James Shingler共同编写...
Groovy 和 Grails 与 Ruby on Rails 一样,都追求开发效率和简洁性,但它们建立在不同的语言基础之上。Ruby on Rails 是基于 Ruby 语言,而 Grails 则是基于 Groovy。虽然 Grails 受到 Rails 的启发,但它采用了 ...
### 敏捷开发与Groovy及Grails技术详解 #### 一、敏捷开发与Groovy及Grails概览 在《Agile Development with Groovy and Grails》这本著作中,作者Christopher M. Judd(Judd Solutions, LLC 的总裁兼顾问)详细...
groovy-grails-tool-suite-3.6.4.RELEASE-e4.4.2-win32-x86_64.part2 共两个包,解压后需要将扩展名.zip.bak改名为.zip重新解压。 http://dist.springsource.com/release/STS/3.8.1.RELEASE/dist/ e4.6/spring-tool-...
Groovy / Grails F4 The Best Web Server
Groovy / Grails F2 The Best Web Server
Groovy / Grails F3 The Best Web Server
Groovy和Grails是两个密切相关的Java平台上的开发工具,它们在构建现代Web应用程序中扮演着重要角色。Groovy是一种敏捷、动态的语言,它旨在减少Java的样板代码,同时提供了可选的动态类型、闭包、领域特定语言...
### Groovy and Grails Recipes 知识点概览 #### 一、Groovy by Example **1. Getting Started with Groovy** - **介绍**: 本章主要介绍了如何开始使用Groovy编程语言。对于初次接触Groovy的新手来说,这是一个很...
《构建集成Node.js与Groovy on Grails的Gumball Machine应用》 在IT领域,跨平台、高效能的应用开发是开发者不断追求的目标。在这个背景下,“grails_nodejsApp”项目是一个独特的尝试,它结合了Groovy on Grails和...
[Apress] Groovy & Grails 新手进阶教程 (英文版) [Apress] Beginning Groovy and Grails From Novice to Professional (E-Book) ☆ 出版信息:☆ [作者信息] Christopher M. Judd, Joseph Faisal Nusairat, ...
Groovy Grails , The best web server.