Archive for the 'groovy' Category

Recently the Groovy team introduced a new operator to the Groovy language. It is called the Elvis operator. There is one thing I particularly like about this operator. It's name.
To bad the Elvis operator is only a shortening of Java's ternary operator, written like ?:. One use-case for the operator is returning a 'sensible default' [...]

In my previous post I had a go at dates and ranges in Groovy. I wasn't to enthusiastic about the fact that it felt a bit verbose and Java-ish. So I took the opportunity to have a go at the new meta-programming stuff in Groovy >= 1.1beta3.
Say I want to be able to do something [...]

Ranges with dates (in Groovy)

During my previous ramblings with Groovy I didn't touch anything fancy in the Date/Calendar API; no need for it. But after reading a lengthy blogpost on the topic I just needed to have a look at it.
Consider the following code:
PLAIN TEXT
GROOVY:

sdf = new java.text.SimpleDateFormat("dd-MM-yyyy")

 

bd_daan = sdf.parse("23-01-1980")   

bd_peter = sdf.parse("18-01-1979")

 

t = Calendar.instance  [...]

During the years I've been involved in digital media related projects quite a bit. With the current dominance of flash video stuff has become a bit more straightforward; you don't have to support multiple proprietary formats in parallel anymore.
I met and read about quite a lot of people building their own mini-youtube on top of [...]

A couple of days ago I wrote my first post on TDD using Grails. Now let's move on to something more interesting: testing dynamic taglibs.
In another post I showed how to create a simple tag. Which looked like this:
PLAIN TEXT
GROOVY:

import com.plink.plextile.*;

class TextileTagLib {

  TextParser textileParser

  def textile = { attrs ->

    out <<textileParser.parseTextile(attrs.text, true)

  [...]

Writing tests for a Grails applications is really simple. In Groovy code actually compiles when non-existing methods of objects are referenced (as opposed to Java) which makes it possible exercise TDD (test driven development).
Grails supports two types of tests out of the box, unittests and integrationtests. Tests are located in the test folder of [...]

BOTG 2007

Yesterday I presented at the Battle of the Geeks 2007 organized by my employer. 4 presentations where given and people in the audience where asked to rate each presentation using special cards. (I translated this post to Dutch for the Finalist developer blog)

19.15 Presentation 1: CMS Container
Freek Punt talked about Finalists' own MMBase based [...]

Groovy 1.1 beta 3: method missing

Groovy 1.1. beta 3 was announced a couple of days ago and includes some interesting additions to the groovy language, like a real method missing. Grails' lead developer Graeme Rocher has a simple example of the way it works in his blog:
PLAIN TEXT
GROOVY:

Foo.metaClass.methodMissing = { String name, args ->

    Foo.metaClass."$name" = { Object[] varArgs [...]

Grails - Soap

Since working with, or creating WebServices is something webdevelopers will probably do regularly (or stumble upon in the very near future) I decided to have a look at Grails' support for SOAP.
First thing I wanted to see was how to expose a Grails service via Soap. Due to the excellent documentation at the Grails website [...]

During Graemes' demo of Grails at javasummercamp he briefly pointed out the fact that one can implicitly use the Groovy MarkupBuilder (Similar to the Markaby DSL for Ruby) within the render method of an action for generating markup.
Which makes writing an RSS feed for you application really easy:
PLAIN TEXT
GROOVY:

def feed = {

  def results [...]




About

Welcome to the weblog of Peter Maas. Here you'll find various posts related to stuff I like (like my kids and espresso) and stuff I do (like developing software).

JavaOne 2008 Pictures


Joshua Bloch at JavaOne2008 Hotel room pub javaone2008 keynote smashmouth javaone 2008 goodybag Tim Bray introducing the (J)Ruby panel Java + You on a cab golden_gate_warning_sign Okke en Rudie Acme Anvile at CommunityOne Keynote Charles Nutter & Guillaume Laforge Stage being build in the nearby park Moscone Center - JavaOne Golden Gate Rudie Stretched Limo sea_lion Greenland Community One Keynote
View more photos >

Categories



Meld u aan voor PayPal en begin direct met het accepteren van creditcardbetalingen.