Tuesday, February 11, 2020
Spock: Expect two calls from one method with specific results.
Tuesday, January 25, 2011
Groovy / Grails User Groups
The Groovy community is benefiting similarly from a growing number of user groups. There are currently a few dozen groups around the world, and more are forming every day.
Now there is a website that can help you find a group in your area or help you get one started. G2Groups.net has a list of active Groovy user groups, with links to their sites. If you can't find one in your area, you can propose one. The site will post a link to your proposal on Twitter; you can retweet this to help get the word out. Then when others are interested in your idea, you'll get emailed about it, and you're off and running!
Once you get a few likeminded (and by "likeminded," I of course mean "brilliant") people together and get a group started, send me a note, and I'll invite you to the Groovy User Group Leaders list on Google Groups. This list is a great way to get support and ideas from other Groovy/Grails/Griffon/Gaelyk/Gradle/Getc. group leaders.
I've always said that the best feature of Groovy and Grails is the community. User groups are a big part of that. So if you're not already involved in a G2Group, get plugged in. You'll be glad you did.
Wednesday, April 7, 2010
ÜberConf
I've been attending technical conferences for over 15 years. I've been to big ones and small ones, free ones and expensive ones. Just doing a quick count in my head, I think I've been to around 35 tech events. Most of these have been as an attendee and on my own dime, because I am convinced of their usefulness and value. More recently I've been speaking at some conferences. Over the years I've become somewhat of a tech conference connoisseur.
Of all these events, the best have been the ones put on by Jay Zimmerman of No Fluff, Just Stuff fame. The NFJS events and others, such as the Groovy/Grails Experience, the Agile IT Experience and SpringOne/2GX, have some elements that other conference organizers just can't seem to duplicate. CodeMash comes close, and the old Borland Developer Conferences were also pretty good, but neither of these are quite up to the level of an NFJS event.
JavaOne used to score real high on the technical content before it became JavaFX One, but the conference organization and overall experience was always lacking. The SD conferences usually had some big names that were worth the price of admission, but the rest of the sessions were hit and miss, and the mobs that were there just for the free expo floor made it so difficult to get to sessions that it often wasn't worth it.
The NFJS events have speakers who are well known, though maybe not as famous as some of the SD headliners. More importantly, they know their stuff, and they have tons of experience in presenting it to others. And since the event size is purposely kept small, it's easy to get to the sessions of interest and easy to get time to talk with the speakers. The schedule is always arranged with plenty of break time for the hallway discussions and questions after the sessions. And all of the little details that we don't really notice but that provide for a much better learning experience are taken care of.
But back to ÜberConf. This event will, I'm sure, have the quality experience and flawless execution common to all NFJS events, but with an expanded focus, expanded schedule and an amazing line-up of speakers (and me too :).
ÜberConf's technical content will be what JavaOne should have been over the last couple years. It will fully embrace Java the platform, with sessions on Java, Groovy, JRuby, Clojure and Scala. ÜberConf goes beyond just the languages and draws from the rich diversity of open source communities that have found a home on the JVM, with Grails, Wicket, Gradle, Maven, Gaelyk, Camel, and more. And since what we're developing with is only part of the story, ÜberConf goes on to bring together some of most important ideas in agile processes from speakers such as Esther Derby, Johanna Rothman, David Hussman, Michael Nygard, and others.
With a mix of 90 minute sessions and 3 hour workshops, and eight concurrent tracks to choose from, ÜberConf will be packed with great content. With attendance capped at 500, it will be easy to get time to talk with speakers and other attendees - and getting to and from the sessions will be easy.
I speak from experience when I say that you will leave this conference full of new ideas and inspiration. Check out the schedule. You'll find plenty of sessions that apply to your current work, but don't stop there. To get the most out of an event like this, you need to go to sessions about topics you know nothing about. You will be amazed at how much you can learn about what you are currently doing by learning about new tools and technologies.
Check out the site for details. There's much more than I've discussed here, including sessions on iPhone, iPad and Android development. For what's included, the full registration price is a steal, but if you register by Monday, April 12th, there's a big discount. So register now, or register later, but do register and attend this awesome conference.
See you there!
Friday, February 5, 2010
My Favorite Tool
That hammer, because of its characteristics (its weight, its size, the pattern on its face, its textured grip, etc.), allowed me to do what I needed to do. Beyond that, it made it easier for me to do what I needed to do. No actually, that's not quite accurate.
The hammer didn't help me do what I needed to do. It helped me to do what I chose to do. In general, I chose to do what I needed to do, but the hammer played no part in that. I had a good boss on that job, and he helped me to determine what I needed to do. I also worked with some very experienced carpenters on that job, and they helped me to learn the right way to do what I needed to do. All the while, my trusty hammer was there just making things easier.
Not all of the tools I used were that way. My circular saw had a safety guard on it that made it difficult to see where I was cutting, and it got in the way when first starting a cut. It would then slide away as I went, but I would often hold it back out of the way when I was starting. The more experienced carpenters just removed their safety guards altogether. I'm sure there were accidents that the safety guards would have prevented, but I guess they were rare enough that most folks decided that the productivity gains were worth the risk. I was always amazed at how fast those guys could frame a house!
I used my saw because I needed to use it, and it was much faster than using a hand saw, but I don't look back at my saw with the same fondness as that hammer. In fact, I can't even remember what brand or model it was. There's just something about a tool that feels good to use: a tool that helps you do what you want to do, and then just stays out of your way.
Tuesday, October 27, 2009
Yet Another 2GX Wrap-up
Speaking of staff, I also want to tip my hat (if I had one) to the guys that pulled it all off. Jay Zimmerman did as good of a job with the 500+ person event as he does with the NoFluffJustStuff conferences and his two volunteers (and one sales guy :), and my co-workers, Erik Weibust, Todd Crone, and Paul Luttrell were tireless in their efforts to keep things running smoothly. It was great working with you guys!
One thing I want to highlight here was how excited I was to see some relative new comers speaking at 2GX. These guys aren't new to Groovy or Grails, but I think this was the first conference appearance for each of them and they were awesome! Matt Taylor, Hamlet D'arcy, Scott Vlaminck (the 'n' is silent), and Burt Beckwith (actually I'm not sure if Burt has spoken at other conferences, so forgive me if I'm wrong)
Matt spoke on Grails UI, the YUI based Grails plugin that he developed and maintains as well as his experiences using Grails "in the wild". I caught his GrailsUI talk and was very impressed, along with the rest of the room who all gave him the coveted "green cards".
I didn't catch any of Hamlet's sessions but from what I heard from other attendees and on Twitter, he was a hit! He gave four presentations altogether: OSGi and Groovy, Functional Groovy, Compiler Metaprogramming with AST transformations, and Legacy Code and Groovy. Rumor has it that he even had Venkat Subramaniam impressed.
Scott Vlaminck, from Refactr, gave talks on Metaprogramming in Groovy and Grails, and AOP in Grails. Again, I wasn't able to catch any of these talks in person, but the feedback was quite good and in fact I happened to be in the room next to one of Scott's talks and the speaker was almost drowned out by the applause!
Burt also gave four presentations. He spoke on Spring Security in Grails, GORM performance, UI performance, and Clustering Grails apps. I only caught the GORM performance talk, but it was one of my favorites. I am already putting things I learned there to use in my day job.
Of course the usual awesome Groovy/Grails/Griffon speakers were there and they were terrific as usual, but you've already heard about them and many others have or will blog about the cool Griffon sessions, or the Grails internals, or the power of Grails plugins, or the DSLs and Groovy testing magic, etc. So I wanted to take a moment to congratulate these guys on a job well done. I look forward to seeing them present at future events.
Now, as to why I don't think this 2GX was quite as good as the first one. The full name of the conference is a clue: SpringOne 2GX. SpringOne is a good conference, but 2GX is a great conference! (or a GR8 conference :) So, when combined we ended up with a more than good but not quite great conference. Spring technology is cool. Much of it (though not all) is behind some of the power of Grails. And I do very much appreciate the support that SpringSource is giving to Groovy and Grails, but I think they just gave a bit of a "corporate feel" to the conference.
I don't want to end on a downer though. There were some distinct benefits of having the two events combined. One was that SpringOne had some very good content and some exceptional speakers to add to the mix. Another is that more than a few Spring users got to glimpse the goodness of Groovy, Grails and Griffon for the first time. The oohs and ahhs were music to my ears! It serves as a reminder to just be patient and hang in there... it's only a matter of time until they'll be holding the Groovy, Grails, Griffon and Spring conference!
Wednesday, September 16, 2009
10 Reasons to attend SpringOne 2GX

The early bird discount ends Friday, September 18th, but even at full price this event is less expensive than JavaOne and will contain way more good technical content. Check out the rest of the speakers and the awesome session list at http://springone2gx.com
If you're interested in Groovy, Grails, Griffon, (or related technologies) or if you use Spring in any of it's myriad forms, or, for that matter, if you use Java, you won't want to miss this conference!
See you there!
Thursday, July 23, 2009
We have a US Groovy/Grails/Griffon Conference!
Tuesday, June 30, 2009
It's Official: Grails has a DZone Refcard!
Tuesday, June 2, 2009
Groovy Buzz at JavaOne
Wednesday, April 29, 2009
We need a US Groovy/Grails/Griffon Conference
But we are way overdue for another. The folks that put that conference together, Jay Zimmerman and Scott Davis, both heroes of mine, tried to organize another but when the economy took a turn for the worse they decided to hold off. I understand their concerns. One only has to look at the desperate attempts at drawing attendees the JavaOne organizers are going through to realize that this is a tough climate for conferences. But hey we're talking about Groovy, Grails and Griffon here.
These are technologies that transcend tumultuous times.
While other conferences are being scaled back or cancelled, The GR8 conference, dedicated to G3 technologies, has had to move to a larger venue! And from what I've heard, the turnouts at the growing number of Groovy and Grails training classes haven't been too shabby. The G3 user group community continues to grow. The Grails podcast audience is climbing. We even have a G3 dedicated magazine. We are ready for a G3 Experience.
So, what are we going to do about it? We could get together and put one on ourselves but I still have faith in Jay and Scott. Anyone who has been to a NoFluffJustStuff or related conference knows that nobody does it better. So, let's let them know that it's time. Here's a few steps you can take:
- Go to the 2GX website: http://groovygrails.com/gg/2gexperience and use the form there to register your interest.
- Go to the NoFluffJustStuff feedback form and tell them it's time. You can even plead for your favorite city.
- Send Jay and/or Scott an email (I'll leave it as an exercise for the reader to track down their email addresses)
- Repeat this urgent plea on mailing lists, news groups, forums, at user groups, at work, in letters to the editor, etc.
- Finally, if you are attending an upcoming NFJS event (coming to Atlanta, Denver, Dallas, Columbus) tell Jay or Scott that it's time for another G3 Experience.
Let's get to work, we can make it happen. After all, we are the G3 community. It's not like we're a bunch of (insert your favorite inferior language or technology here) hackers!
I'll see you at the next G3 Experience!
Tuesday, April 28, 2009
Linux Journal Readers Choice Awards
Sunday, March 1, 2009
Thoughts on Groovy, Grails, Griffon and JavaOne
Anyhow, it's important to note that last year there weren't all that many Groovy related talks either, but what I observed was that Groovy was represented as much by excited attendees as by presenters. I think it can be the same this year. Some of the brightest minds in the G3 community will be at JavaOne and they will have many opportunities outside of the session rooms, to talk about and demonstrate the power, efficiency and fun of Groovy, Grails and Griffon. The rest of us can do the same. So if you can make it to JavaOne go for it and feel the Groovy in the air!
Speaking of enthusiasm in the community, here are a few examples:


Saturday, February 28, 2009
First NoFluffJustStuff of the year
There are also new sessions from Neal Ford, David Geary, Ken Sipe, Venkat Subramaniam, Mark Richards, Stuart Halloway and Brain Goetz. Since I haven't mastered the art of being in two places at once I will pretty much be in the Scott Davis track and then the Brian Goetz track.
I'll try to post more later. For now back to the dim sum!
Tuesday, November 11, 2008
Congratulations to SpringSource!
Tuesday, August 26, 2008
BGG takes top honors at CapJug Meeting!
When we have this many books to give out we like to treat it like a poll. So, I'll describe each of the books and then start drawing names. Each winner can take their pick from the books remaining. I am happy to announce that Beginning Groovy and Grails was the first pick! Congratulations to Christopher, Joseph and James! The CapJug pick of the months is quite an honor. We still have another copy to give away next month so we'll see if they can hold the record for a second month.
It is great to see the growing interest and excitement in Groovy and Grails at our Java User Group and I know that ours is not unique. Java User Groups all over the world are beginning to embrace the next generation of Java!
Wednesday, June 11, 2008
Grails to the Rescue
I've read and heard about death march software projects before but I had never experienced one until recently. About a month ago I was put in charge of a 2 1/2 year JSF/EJB project that had 8 months left and was less than half done. (By the way, that's my excuse for not blogging in a while. It's not as good as Glen Smith's excuse but it's all I've got) At first this was quite disheartening. I assessed the situation and made it clear that there was no way that we could meet the deadline but was told to just "do the best we could". So, I marched on...
Then, as I dug into the project more, I discovered that there were major pieces of the application that were isolated enough that they could be done in a different environment without impacting the overall system. Grails to the rescue. We are now using Grails for most of the remaining development and gaining momentum quickly. Two of the four of us on this team have Grails experience but the other two are coming up to speed very quickly and, I might add, enjoying their jobs more than they have for some time. One of the pleasant side effects of using Groovy and Grails is increased job satisfaction and motivation.
While there's still much to do and it is still unlikely that we will make that deadline, switching from JSF/EJB to Grails has turned this death march into a forlorn hope. In this case the reward won't be fame, glory and promotion but it just might be another IT shop standardizing on Groovy and Grails. Here's hoping!
Saturday, May 17, 2008
Introducing JugList.net
JugList.Net is a searchable directory of Java User Groups around the world.

You can search for a JUG (Java User Group) by name, city, state/province or country. If you still can't find a JUG in your area, there is a link to an article, by yours truly, that gives some tips on starting your own group.
Java User Groups are a valuable resource for honing your craft and building your career. They also provide a great way for experienced programmers to give a little back to the community. If you are not involved in a JUG yet, then check out juglist.net and find one near you.
Friday, May 16, 2008
Another way to use Groovy in the Enterprise
In this example we'll build a utility class that will use convention to turn an SQL select statement into a List of data transfer objects.
Our goal here is to take an SQL statement and a Class, execute that statement and use the results to populate instances of the Class. We will assume the convention of camel case for object properties and underscores for database fields, so that a field called LAST_NAME would be mapped to a property called lastName. We will also assume that the select statement will only return fields that have a corresponding property in the Class.
So let's see what this might look like:
static Collection getData(String query, Class clazz, Connection con){
def field = ''
def result = []
def sql = new Sql(con)
sql.rows(query).each {row ->
def dto = clazz.newInstance()
row.keySet().each{
field = toCamelCase(it)
dto."${field}" = row."${it}"
}
result << dto
}
result
}After defining a few variables, we create our groovy.sql.Sql object using the constructor that takes a Connection. This will allow us to use Connections provided by an application server such as WebLogic or WebSphere. We could easily change this method to take advantage of the other constructors.
Next we'll call the rows method of the Sql class, which will execute the SQL statement and return an ArrayList of GroovyRowResults. Now we'll iterate through this ArrayList and create a new instance of our DTO class for each row. GroovyRowResult implements the Map interface so we can loop through its keys with row.keySet().each. This will give us each of the fields in that row and we will turn them into property names with a call to the toCamelCase() method (which we'll look at shortly). Notice how we take advantage of GStrings to dynamically access properties of our DTO as well as keys of the row map. After we assign each of the fields in the row to properties of the DTO instance we add it to the result List. When the loop is done we just return the List. Obviously, more can be done to make this more robust and more flexible, but it's pretty amazing how easy it was to build a Groovy class that can replace tons of repetitive Java code.
Let's take a look at how we could use this class from a Java project:
...
Connection con = getConnectionFromPool();
String query = "SELECT FIRST_NAME, LAST_NAME, EMAIL FROM MEMBER";
Collection members = GroovyData.getData(query, MemberDTO.class, con);
...
That's all there is to it.
Now let's take a quick look at the toCamelCase() method we mentioned above. This doesn't directly have anything to do with the purpose of this post, but I am hoping that someone might see this and offer a groovier way to do the same thing. Basically the goal is to take a database field name such as LAST_NAME and turn it into a camelCase string like lastName. Here's how I did it:
static String toCamelCase(String val){
def sb = new StringBuffer()
Boolean newWord = false
val.toLowerCase().each{
if (it == '_')
newWord = true
else{
if (newWord){
newWord = false
sb << it.toUpperCase()
}
else
sb << it
}
}
sb.toString()
}I was sure there was a groovier way to do this and, sure enough, Andres Almiray came up with this awesome improvement:
static String toCamelCase(String val){
def result = val.split("_").collect { word ->
word[0].toUpperCase() + word[1..-1].toLowerCase()
}.join("")
result[0].toLowerCase() + result[1..-1]
}Thanks Andres! And if that wasn't groovy enough, Ted Naleid came up with this cool mix of regular expressions and meta-programming. Good stuff Ted!
def camelCaseConverter(orig) {
orig.toLowerCase().replaceAll(/_(\w)?/) { wholeMatch, firstLetter ->
firstLetter?.toUpperCase() ?: ""
}
}
String.metaClass.toCamelCase = {->
camelCaseConverter(delegate)
}Thursday, May 1, 2008
Groovy and Grails at JavaOne
Then for the rest of the week a groovy search in the Content Catalog turned up the following list:
ID | Session Title | Speaker(s) | Date / Time | Room | |
TS-5771 | The Duke and the Elephant: PHP Meets Java™ Technology--the Best of Both Worlds | Rob Nicholson, IBM |
| Esplanade 301 | |
TS-5764 | Grails in Depth | Guillaume Laforge, G2One, Inc., Graeme Rocher, G2One Inc |
| Esplanade 307-310 | |
BOF-5613 | Jersey: RESTful Web Services Made Easy | Jakub Podlesak, Sun Microsystems |
| Esplanade 307-310 | |
PAN-5435 | The Script Bowl: A Rapid-Fire Comparison of Scripting Languages | Guillaume Laforge, G2One, Inc., Charles Nutter, Sun Microsystems, Inc., Jorge Ortiz, Stanford, Raghavan Srinivas, Sun Microsystems, Inc., |
| Gateway 104 | |
TS-5572 | Groovy, the Red Pill: Metaprogramming--How to Blow the Mind of Developers on the Java™ Platform | Scott Davis, Davisworld Consulting, Inc. |
| North Mtg-121/122/124/125 | |
TS-5815 | Going Mobile with JavaFX™ Script Technology, Groovy, and Google Android | Mike Mannion, Canoo Engineering AG |
| Esplanade 301 | |
TS-6050 | Comparing JRuby and Groovy | Neal Ford, ThoughtWorks Inc. |
| North Mtg-121/122/124/125 | |
TS-5274 | Groovy on a Cloud: Testing Java™ Platform, Enterprise Edition (Java EE Platform) Applications on Amazon EC2 | Chris Richardson, Chris Richardson Consulting, Inc. |
| Gateway 104 | |
TS-6213 | Boldly Go Where the Java™ Programming Language Has Never Gone Before | Geert Bevin, Terracotta |
| North Mtg-121/122/124/125 | |
BOF-5102 | Cooking Your Own Groovy Builder: A Step Forward into Domain-Specific Languages | Andres Almiray, Oracle, Ixchel Ruiz, Clemente Camara y Asociados |
| Gateway 104 | |
BOF-5110 | Extending Groovy’s Swing User Interface in Builder to Build Richer Applications | Danno Ferrin, Intelligent Software Solutions, Inc., James Williams, Spatial Networks |
| Hall E 133 | |
TS-5793 | Groovy and Grails: Changing the Landscape of Java™ Platform, Enterprise Edition (Java EE Platform) Patterns | Guillaume Laforge, G2One, Inc., Graeme Rocher, G2One Inc |
| North Mtg-121/122/124/125 | |
TS-5693 | Writing Your Own JSR-Compliant, Domain-Specific Scripting Language | John Colosi, VeriSign, Inc.; David Smith, VeriSign Inc. |
| Esplanade 301 | |
TS-6457 | Choosing Your Java™ Technology-Based Web Framework: A Comparison | Richard Pack, Hyperic; Stacey Schneider, Hyperic |
| Esplanade 307-310 | |
TS-6606 | Patterns for Integrating Java™ and JavaScript™ Technology: Tales from the Front Lines | David Caldwell, David P. Caldwell, Inc. |
| North Mtg-121/122/124/125 | |
BOF-5101 | Boosting Your Testing Productivity with Groovy | Andres Almiray, Oracle;, James Williams, Spatial Networks |
| Gateway 102/103 | |
TS-5098 | Building Rich Applications with Groovy's SwingBuilder | Andres Almiray, Oracle;, Danno Ferrin, Intelligent Software Solutions, Inc. |
| Esplanade 305 | |
TS-6050 | Comparing JRuby and Groovy | Neal Ford, ThoughtWorks Inc. |
| Esplanade 303 | |
TS-6039 | Jython - Implementing Dynamic Language Features for the Java™ Platform Ecosystem | Jim Baker, Zyasoft, Tobias Ivarsson, Neo Technology |
| Esplanade 305 |
Well, if you read this far and if you happen to be wandering around the Pavillion on Tuesday afternoon at 3:30, I will be giving a mini-talk on Java User Groups at the java.net Community Corner. (That way I can say that I gave a presentation at JavaOne).
Monday, April 14, 2008
NoFluffJustStuff JUG Events
As the leader of a JUG (Capital Java User Group - Madison, WI) I appreciate all the support that the folks at NoFluffJustStuff provide to the Java community. As a Groovy / Grails developer, I also appreciate the way that they are helping to usher in the next generation of Java!
