2nd day at Grails Exchange

Well, first of all, I really have to beach about public transports in London. Yesterday the Central line wasn‘t working and today the Northern line had severe delays. It took me 1:30 hour to go from south London (Balham) to the conference hall (the Barbican Center). I love London, it‘s a fantastic city and I really enjoyed leaving here for 2 years. But each time I come back for business (not for holidays where I can just wonder around) I remember why I left this city and went back to Paris : on a day to day basis, London is a really tough place to live in. Well, I suppose some people would say the same about Paris though…

Enough beaching. Second day at the Grails Exchange.

The keynote started at 9:30am and was done by Scott Davis. He talked about open source in general, Groovy and Grails in particular, the economic model of open source, the way companies look at open source (he showed a photo of a guy with long hippy hair… I wonder if it was a photo of Scott). Grails is a fantastic story about open source because it embeds famous open source frameworks (Spring, Hibernate, Log4j…). Talking about figures and economics, Scott showed us some curves going up (Apache software being used more and more) and others going down (lines of code with Groovy). Companies have started to look at open source because it‘s cheap (zero dollars to buy), they should start looking at Groovy/Grails because it‘s also cheap (less code). And they should keep in mind that Groovy benefits from Java, “in fact, Groovy is Java” repeated Scott. Groovy is getting big (other figures about software language usage) and just won an award. Scott‘s presentation was very interesting and, even not talking about technical stuff, he made it quite funny.

Panel discussion with Jeff Brown, Scott Davis, Dierk Koenig, Guillaume Laforge, Graeme Rocher. That was a question/answer type of session. And here it goes. Can Grails be more than a web app . Well, it already is, you can use GORM without Grails for example. You can write the same thing in different ways in Groovy. Strange syntax . It helps on the learning curve. Java developers can start using java-like syntax (with semi-colon or brackets) because that’s what they are used to. And they can gently move to a more Groovy syntax. I’ve asked if it will be possible in the future to use different frameworks in grails . It could be possible. Graeme gave the example of Hibernate. Difficult to switch from Hibernate to a JPA implementation yet (like Toplink) because JPA doesn’t have criterias. And GORM uses criterias extensively. How to convice Rhino, Javascript developers to move to Groovy . No DSL in JavaScript, syntax closer to Java, object oriented language, sandbox security. How will Groovy evolve with G2One leading the development . Groovy will always follow the community. And by having 4 fulltime people working on Groovy and Grails, debug will be faster, shorter milestones, improve documentation. Scott gave the example of Linux. Customers started to move to Linux when there was a companies like RedHat helping them. Same thing will occur with Groovy. I’ve asked a second question about the funny marriage between Groovy and Sun . Groovy has its JSR and so on, but Sun seems to encourage Ruby (employed some JRuby guys). Sun is a big company with different people leading different projects and different ideas. Scott said something interesting about Ruby being aggressive against Java, so companies like Sun or Microsoft, followed them thinking that is the way to go. And what about future of Java releases getting Groovier (like closures) . Graeme said he‘s concerned about the Java language getting more and more complex and verbose (proliferation of annotations).

Domain Specific Language by Guillaume Laforge. Guillaume gave a similar talk at the OSSGTP but I missed it at the time, so I came to this session. Guillaume started to explain what a DSL is and why and when it should be used. Basically it‘s to use a more expressive language, share a common metaphor and finally help domain experts without technical code getting in the way (eg. 30.euros + 15.dollars). There are several ways to integrate DSL. Either through JSR-223 (javax.script) or Groovy or Spring (POGOs and POJOs can be injected in each other). Guillaume finished his talk by giving us some recommendation. The one that creates a lot of Q/A was that to ensure DSL adoption you have to make users build their own DSL. That reminded me the UML Use Cases that users are supposed to write and they don‘t. If they can‘t write a word document, how will they be able to write a DSL… lazy users.

Unit testing & Mock Objects with Groovy by Dierk Koenig. Dierk started saying that he will go in depth on how to setup unit testing with Groovy. That took him one slide. Unit testing just comes with Groovy. Dierk didn‘t use many slides and preferred making demos (using Intellij Idea). That was good. Some time a bit of playing around with code make things more understandable. And when he came to explain Stubs and Mocks, you need a bit of code to understand complex things. As he said, Stubs replace an object because you specify the expected behaviour. On the other hand Mocks are set up like Stubs but they verify the expectation. I didn‘t know this story but Dierk said that he developed Stubs and Mocks (based on EasyMock) because the section on unit testing of his book wasn‘t good enough. So, he developed it, to write about it. Pretty amazing. Dierk is really easy to listen to and understand what he says. Well done.

Dynamic Groovy Meta Magic by Graeme Rocher. Graeme started his talk by clarifying the definition of dynamic, static, weakly type and strongly typed. Groovy is a dynamic strongly typed language. Even if you use the def keyword on an attribute, at runtime this attribute will get eventually strongly typed to something. He then dived into the Meta Object Protocol (MOP) which is the mechanism that makes the semantic of a program extensible (eg. DSL). Not only Groovy uses MOP, but also Ruby, SmallTalk and LISP. There are several MOP strategies: MOP hooks, Groovy categories and ExpandoMetClass. With Expando you can add methods, properties, static methods and constructors at runtime. Like in GORM for example. When you write Castle.findByName, the method findByName doesn‘t exist. The framework will intercept the MethodMissingException and create the findByName method (using Hibernate criterias). This means that the second time the findByName method is called, it will exist and just be invoked.

Web development with JBoss Seam by Christian Bauer. Well, I should have looked closer at the title, but there was no Groovy involved in that talk. I‘ve used Seam a little bit so I knew most of the stuff that Christian was saying. Anyway, it’s always interesting to listen to knowledgeable speakers. Christian actually started the session saying that he doesn‘t know Groovy nor Grails. Before introducing Seam he showed us a typical Java EE 5 application with JSP pages embedding JSF tags and expression language, JSF managed beans, stateless and entities. He spotted the benefits of Java EE 5 compare to J2EE 1.4 : no DTOs, less noise (no struts, EJB 2), more transparent (no direct call to HTTPSession or HTTPRequest), much simpler ORM and cleaner MVC. But, and there is always a but, the JSF backbean is just noise. Plus other problems like no multi-window browser support, application leak memories (nearly everything is stored in the session with JSF), back button, double click… So, here comes Seam. Seam takes care of all these issues. It unifies EJB and JSF. On one of his last slides, he mentioned that Seam component could also be a Groovy class.

Setting up Grails in an Agile Environment by Fabrice Robini & Arnaud Heritier. Fabrice started the talk presenting Agility (iteration, TDD, continuous integration, quality report). He then gave the definition between unit tests (class and method in isolation) and acceptance tests (business logic, written by customers, no technical knowledge). So he introduced Fitness. Fitness is an acceptance framework that can test Java, of course, but also Grails services and controllers. And then Fabrice did a demo of Fitness, with lots of copy/paste from Excel (customers love Excel). The second part was about the Maven-Grails plugin that Arnaud is currently developing. Maven and Grails is a marriage of inconvenience (both use different conventions like directories) but they are complementary. In his demo, Arnaud generated a Pom from a Grails application. Cool.

Well, after there was some drinks, a session made by a Groovy and Java user groups, and more drinks.

More tomorrow.

Categories: Groovy, News

Tagged as:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s