Suggested Parleys Watchlist for Devoxx 2013

This year we attended Devoxx 2013 with a total of 9 JDriven colleagues. After more than a week we finally recovered from a vast amount of great sessions, personal encounters and  ‘some’ Belgian beer. Looking back at Devoxx we had a great conference and like to thank the Devoxx team for making this possible. It was also good to notice that the majority of the sessions are related to subjects that drive us at JDriven, during our daily job and while further developing our expertise and craftsmanship, to name a few: Continuous Delivery, AngularJS, RESTful API’s, Gradle, Groovy, Grails, Java 8, Java EE.

The Devoxx 2013 sessions will be available at Parleys soon, hopefully just before the holidays. To protect you from infobesity we’d like to share our list of must watch sessions with you:

Suugested Parleys Watchlist for Devoxx 2013

Sven Peters – How To Do Kick-Ass Software Development
Sven, a presenter who is just full of energy, tells how software is developed at Atlassian and how they can build great software with even greater pleasure.
He explains how a good team, becomes a kick-ass team. He also mentioned that we as developers are always working to help automate others, but often forget to automate our own work. The presentation contains lots of tips and tricks.

Guillaume Laforge – What Makes Groovy Groovy
A great overview of the various aspects and power of Groovy targeted at Groovy newbies. The presentation contains great code examples, starting with Java code and showing off the Groovy alternatives ending up with less code but exactly the same functionality. A great session and good overview of how Groovy enriches (and improves) Java. Probably not too much news for Groovy experts but for a newbie certainly valuable.

Ben Hale – Designing a REST-ful API using Spring 4
Very good presentation that covered lot’s the concepts of the REST standards (or lack of it) and how to implement this using Spring 4 features and Spring-HATEOAS.

Seth Ladd – Mobile, multi-device, multi-player with HTML5 and Dart
A pretty solid, almost marketing, talk about developing the word game Boggle entirely using Dart. Seth also demonstrates his own recently developed API for offline-enabled browser-based web apps: Lawndart. The application has been developed as set of custom reusable components using polymer.dart (instead of angular.dart).
This presentation gave a great overview of Dart and the initial impression of Dart is very impressive. It certainly creates interest in investigating and playing with Dart.

Paul Sandoz – in full flow: Java 8 lambdas in the stream
A clear overview of the use of the new stream API to declaratively perform actions on lists using lambdas. Also the benefits and pitfalls of using streams in combination with multithreading are explained.

Simon Ritter – Is It A Car? Is It A Computer? No, It’s a Raspberry Pi JavaFX
A very nice session that explained how a Carputer could be made from a RaspberryPI and the risks you introduce when connecting your car with a RaspberryPI.
Using a touch screen connected to the RaspberryPI and an application developed using JavaFX to operate and view the data from the on-board computer.

Tugdual Grall, David Pilato – Elastify your app: from SQL to NoSQL in less than one hour!
Within an hour, a simple application backed by a SQL database is converted to a CouchBase database and then coupled with a Elasticsearch. The steps to take to convert the existing application are clearly explained. After the conversion, the data in the system is visualized using Kibana.

Geert Bevin – Programmers are way cooler than musicians
Geert Bevin presents the Eigenharp, a musical instrument which has been built on a completely different approach from it’s predecessors. Throughout his presentation he shows not only the instrument but also hints at the possibilities one gets if he lets go of “how things are”. An interesting display of thinking outside the box leading to a new design.

Hans Dockter – Gradle for Android and the Rest of the World Conference
Hans illustrated the possibilities and power of Gradle by explaining how the Gradle based build system for Android works. This new build system has been developed as a Gradle plugin by the Google Android team. He also noted that some people see the flexibility of  Gradle as a downside but stated that the opposite is true because you can use the power of Gradle to limit this flexibility. For instance you could fail a build when dependencies from a non whitelisted  repository are used.

This is just our short list ;) but have fun and see you next year @Devoxx!

Grails Goodness: Register Custom Marshaller Using ObjectMarshallerRegisterer

When we convert data to JSON or XML (or any other format actually) in our Grails application we can register custom marshallers. These marshallers must contain the logic to convert an input object to a given format. For example we could have a book class and we want to convert it to our own JSON format. We have different options in Grails to achieve this, but for now we will create a custom marshaller class CustomBookMarshaller. This class must implement the ObjectMarshaller<C> interface. The generic type is the converter the marshaller is for and is in most cases either grails.converters.XML or grails.converters.JSON. Next we must make sure Grails uses our custom marshaller and we must register it. In the Grails documentation is explained how to do this via grails-app/conf/Bootstrap.groovy where we invoke for example JSON.registerMarshaller(new CustomBookMarshaller()). Or via grails-app/conf/spring/resources.groovy where we must write an extra component with a method annotated @PostConstruct where JSON.registerMarshaller(new CustomBookMarshaller()) is invoked.

But there is also another way using org.codehaus.groovy.grails.web.converters.configuration.ObjectMarshallerRegisterer. This is a Spring bean just for configuring extra marshallers. The bean has a priority property we can use to define the priority for this marshaller. Grails will use a marshaller with the highest priority if for the same class multiple marshallers are defined. We can assign a marshaller to the marshaller property. And finally we must set the converter class, for example grails.converters.XML or grails.converters.JSON with the converter property.

Continue reading

Grails Goodness: Include Domain Version Property in JSON and XML Output

We can include the version property of domain classes in rendered JSON or XML output. By default the version property is not included in generated XML and JSON. To enable inclusion of the version property we can set the configuration property grails.converters.domain.include.version with the value true. With this property for both XML and JSON the version property is included in the output. To only enable this for XML we use the property grails.converters.xml.domain.include.version and for JSON we use the property grails.converters.json.domain.include.version.

Continue reading

Grails Goodness: Pretty Print XML and JSON Output

If our Grails application renders XML or JSON output we can set configuration properties to enable pretty printing. This can be useful in for example in the development environment where we enable pretty printing and disable it for other environments. We set the configuration property grails.converters.default.pretty.print with the value true to enable pretty printing for both XML and JSON output. If we only want to pretty print XML we use the property grails.converters.xml.pretty.print and for JSON we use grails.converters.json.pretty.print.

Continue reading

Grails Goodness: Create Report of URL Mappings

Since Grails 2.3 we can use the url-mappings-report command to get a nice report of the URL mappings we have defined in our application. Also implicit mappings created for example by using the resources attribute on a mapping definition are shown in the report. This report is very useful to see which URLs are exposed by your application and how they map to controllers.

Continue reading

Grails Goodness: Get Request Parameters with Default Values

In Grails we can convert a request parameter to a type directly. We must then use the int(), short(), byte(), long(), double(), float(), boolean() or list() methods that are added to the params object available in our controllers.

Since Grails 2.3 we can also pass a default value, which is used when the request parameter is not set. In the following controller we use the double() method and define a default value of 42.0.

Continue reading

Grails Goodness: Generating Raw Output with Raw Codec

Since Grails 2.3 all ${} expression output is automatically escaped on GSPs. This is very useful, because user input is now escaped and any HTML or JavaScript in the input value is escaped and not interpreted by the browser as HTML or JavaScript. This is done so our Grails application is protected from Cross Site Scripting (XSS) attacks.

But sometimes we do want to output unescaped HTML content in the web browser. For example we generate the value ourselves and we know the value is safe and cannot be misused for XSS attacks. In Grails 2.3 we can use a new raw() method in our GSPs, tag libraries or controllers. The method will leave the content unchanged and return the unescaped value to be displayed. Alternatively we can use encodeAsRaw() on the content we want to leave unescaped. Finally the encodeAs tag accepts Raw or None as values for the attribute codec and will return the unescaped value.

Continue reading

Grails Goodness: Customize Resource Mappings

Since Grails 2.3 it is very easy to define RESTful URL mappings for a controller. We can use the resources and resource attribute and use a controller name as the value. Grails will then automatically create a couple of URL mappings. Suppose we use the following mapping in grails-app/conf/UrlMappings.groovy: "/api/users"(resources: 'user'), then the following mappings are automatically created:

Continue reading

Grails Goodness: Namespace Support for Controllers

In a Grails application we can organize our controllers into packages, but if we use the same name for multiple controllers, placed in different packages, then Grails cannot resolve the correct controller name. Grails ignores the package name when finding a controller by name. But with namespace support since Grails 2.3 we can have controllers with the same name, but we can use a namespace property to distinguish between the different controllers.

Continue reading