Tuesday, April 22, 2008

Hair Colour Chart Wella Koleston

Grails - the grail of web development

man, oh man! Twice already I wanted to listen to this talk in Hamburg already - in the XP User Group and at HAW. Both times has not worked out, so it must go here at last. I come from the corner of web development and the issue is not quite let go of me also determined, although at the moment I rather service-oriented and Eclipse RCP-heavy'm out. Maybe there's also new ideas for an RCP Grail, for convention over configuration where it has not yet taken it. Moreover, in my opinion, this "weakest" Session Round (in this case I had to choose only four talks) and we have divided us and we miss something colleagues technically there is nothing relevant. Hopefully.
The presentation style - at least the start - is great already. Personally, I stand on these kind of talks. On the basis of "practical examples" illustrate the two web frameworks: It is more of a breakdown Show in pictures from all sorts of areas, with transmission to the web framework. The films then are more classic, but well, it will indeed be not only cool but also informative.

Spring, Hibernate and SiteMesh are the basics of Grails, Groovy is just the icing on this basis. And as the icing is thin, the application will not be thick, to be called by the slow but relatively low performance. In addition to these basic Grails plug in other libraries for Ajax, batch, safety and testing. Actually there are old acquaintances from the world of web development.

Now comes a crash course Groovy, I give not more times. For Java developers, the start was so suuper-light, but as always, of course, it takes a while until you reach really think of the language. I ride around on it again - who can LISP, ... well, we can also Stefan Roock What this points again: Groovy and Java work seamlessly, you can access Java classes in Groovy classes, and vice versa.

now to Grails: First of persistence: Domain Objects are mapped automatically. I have to do so no Hibernate configuration, no JPA annotations or anything else, it starts immediately. Although one admit, then it does not stop here, annotations, or making it something, but on the convention that domain is in a package and that uses the fields or hasMany belongsTo who will each receive a map. Constraints are such as defined by a closure that contains a DSL. Exciting concept. Stefan Roock also points out that it is easier to do when it only accepts times and does not try to understand it first time and making it then. Certainly true, the concept is easy to use. As the figure happened to the database constraints have to know not really. But it shows nicely the Groovy think.

The dynamic finder is really interesting because He beautifully illustrates the dynamics of language: Adresse.findAllByPostleitzahlAndGueltigBis (21 502, null). A MOP (Metaobject Protocol) has real benefits! Between the question of the IDE support is of course interesting: IDEA has the best support, Eclipse and Netbeans pull to there.

groovy server pages and related SiteMesh rely completely on taglibs. This can of course do so also in Java itself, but Grails brings it all to stop.

We model and view, the controllers connect this controller to identify this in a separate package and the suffix Controller. Interestingly, the individual actions are not implemented as methods, but as closures, stored in fields.

Now it is already in the preserves: AJAX is installed (Prototype / Script.acoluo.us, Yahoo UI as a plugin, Dojo as a plugin). Taglibs can build yourself: Again by convention taglib purely throw in their own folder and you have a taglib taglib done. Stefan Roock points out that one uses the simplicity in Grails taglibs own projects more frequently than in Java projects. I think once.

testing is directly involved in Grails. It generates skeletons for domain classes and controllers, integrated running tests in the provided scripts, etc. Yet this is rather slow because the VM, the framework and the Web server from time to time is again up-down and resuming. Stefan Roock

now come on to RESTful services with Grails, very interesting, but which we might almost too deep. The audience sweat some of them already.

But, it's almost done. Now do it (after the inevitable commercial) for a live demo. So, Console, TextMate, and off you go. Bernd Schiffer builds first time a new Grails application. Or he can build a new application, from the corresponding Grails script.
The domain class is again generated by script. First time that's not exciting, but plug-ins for Grails can engage here and so, for example, to the domain class and a test class generated.

Now you can start the application (which runs internally Jetty high). Still nothing much happens - the application starts up, but it is only the Grails default page view. So - Server continues to run - makes Bernd Schiffer is a corresponding controller. Which one can already see on the home page. Still missing a View, but the folders are already created. So hastily created a gsp page.

far to see everything without a server restart.

In class BootStrap there's an init (and destroy) method, there still comes out a bit init code (create domain object), start server and stop (otherwise the bootstrap init method does not run). And already you can see what.

Now you go about adding more links, more code in the controller, etc. So we carry. The questions go in the noise, about data sources, the underlying database to choose refactorings are not supported really well, there are several possibilities, (Java) to integrate legacy code. With DB Migrate you can perform the migration of database schemas.

Still my conclusion: The talk was a good introduction with a nice blend of theoretical insight and a practical part. Groovy is definitely worth a look. When now is the book?


0 comments:

Post a Comment