DZone interviews: Ken Kousen on Making Java Groovy
Join the DZone community and get the full member experience.Join For Free
welcome to another installment of dzone interviews here at groovy zone. on this occassion we interviewed kenneth kousen, a name that should be familiar to people browsing the groovy user mailing lists as ken is quite active there. i won't spoil the contents of the interview with this introduction but let me tell you ken is one of those people that put a smile on your face every time you have a chance to chat with him. enjoy!
andres almiray: could you please introduce yourself
kenneth kousen: my name is ken kousen. my last name is actually pronounced “cousin”, like the relative. my primary job is teaching technical training courses in areas related to java and xml, including open source projects like spring, hibernate, and of course groovy and grails.
i’m run a one-person company called kousen it, inc. when i say the company name out loud, i spell out it, but my wife always says cousin itt like the character on the addams family. hey, it was her idea. i travel a lot for my job, but i’m based in connecticut, in a small town southeast of hartford. think red sox, not yankees.
like many people in it, i was a career changer. my career started as a research scientist working for united technologies. i used to investigate the unsteady aerodynamics and aeroacoustics of axial turbomachinery, which is a fancy way of saying i studied noise in jet engines. that itself is a fancy way of saying i did lots of math and lots of fortran (the nightmares have ended, but it took a while). that’s why i have all those academic degrees (bs in mathematics and bs in mechanical engineering from m.i.t., ma and ph.d. in aerospace engineering from princeton, ms in computer science from r.p.i.). research was fun when it worked, but i really hated the “begging for funds” part. i knew i was in the wrong field when fortran 90 came out and i was excited about it (oooo, encapsulation!) and all the engineers around me still thought arithmetic if statements were fine. i do remember during the recession in the early 90’s making a sign that said, “will numerically integrate partial differential equations for food,” but my company didn’t think it was funny.
i eventually moved into an artificial intelligence group, where i got to play with genetic algorithms and neural networks. it took me about two months to realize that ten years of coding in fortran hadn’t taught me anything about software development, which is why i went back to school and got the ms degree in cs. after completing it i left and joined a training company. five years later i went out on my own.
in 11 years as a trainer, i’ve never missed a training day. if, as the saying goes, half of life is just showing up, i’ve got that part covered.
andres: what drove you into groovy?
ken: like many developers, i got caught up in the ruby on rails comet that soared across the development sky in 2005. i had many years of java experience at that time, but i found ror dazzling. i remember watching dave thomas (the ruby guy, not the wendy’s owner) doing a ror demo and hearing audible gasps in the room as he added more and more features. now it’s fun to watch jeff brown do the same thing with grails and get a similar reaction.
i quickly realized that i couldn’t make any real progress with ror unless i learned ruby, but despite what the books said i found it a difficult transition. at the time i was probably too heavily invested in the java world to really “get” ruby, though i keep meaning to go back. i’m sure it would make much more sense now. as a trainer, my job is very sensitive to market conditions, and back then i couldn’t get a lot of ror training work. since i never really felt competent doing ror anyway, i stopped working on it a few months later.
late in 2006, though, i happened to be in philadelphia teaching a spring framework class when i noticed the local spring users group was hosting jason rudolph, who was doing a presentation about grails. since i was already comfortable with spring and hibernate and i was familiar with dry and convention over configuration from ror, i was the perfect target audience. he was great, of course. if you get a chance to see him, don’t miss the opportunity.
i immediately bought the first editions of “definitive guide to grails” (dgg) and “groovy in action” (gina, still my all-time favorite technical book) and never looked back. groovy makes development fun again.
andres: it’s true. when the topic of grails is brought forward in a conversation with java developers some will still refer to it as “groovy on rails” or brand it as a rails clone. from your experience, what can you tell us about the similarities and differences between ror and grails?
ken: grails has a lot of advantages over ror, especially from a business point of view. grails is built on hibernate, and hibernate works with practically anything. that means grails can work with existing databases. that leads to one of the grails sweet spots, building simple applications that maintain a set of database tables inside a company.
grails is also built on spring, which i like to call a swiss army chainsaw because it touches on nearly every aspect of enterprise java development. anything that can be done with spring eventually makes its way into grails, usually through a plugin. the vast set of available plugins is a great asset for grails development. one demo i like to do for students is to build a quick grails application, then add the searchable, quartz, email, and richui plugins. then i’ll throw in either apache shiro or spring security. i wind up with a very powerful application with lots of features in very little time.
i have to say, though, that if you really want a great demonstration of grails, you need to watch jeff brown’s “build twitter in 90 minutes with grails” video at http://www.youtube.com/watch?v=8d1hp8n1sta .
sometimes the part that impresses people the most, though, is when you just type “grails war” and deploy the resulting war file in one step.
seriously, if your shop has any java experience, you owe it to yourself to look at grails for your next application.
with all that said, i still spend much more time using groovy than i do with grails. i like grails and prefer it for web applications, but i use groovy for everything.
andres: what do you consider to be the killer feature for groovy?
ken: that’s a hard question, because i like so many features. probably the most useful one, though, is its xml parsing (and slurping) and generation capabilities. whenever i have a task to do in a java application that need to work with xml, i always add a groovy class to handle that. of course, i like using groovy collections, and closures, and all the methods added by the gdk, and so on.
andres: is it true you teach groovy for a living? how's the experience so far?
ken: i wish i could say i spend all my time teaching groovy and/or grails, but for me at least the market doesn’t support that. i get the impression that the situation may be different in europe, where open source seems to be more popular. here in the u.s. i’ve only taught a handful of grails courses and even fewer straight groovy courses over the past few years. i normally operate as a sub-contractor to training companies, though i occasionally work with companies directly. i’ve been telling my clients that this is the year groovy finally breaks through to the mainstream. of course, i’ve been saying that for the last four years.
i will say, though, that i’ve definitely seen a transition. a few years ago, when i mentioned groovy or grails, the reaction was, “you mean ruby on rails?” in the last two years the reactions changed to, “yeah, i’ve heard of them but don’t know much about them.” now we’re in the “well, we have a few developers working on a pilot project that we don’t talk about to upper management” stage.
on my web site ( http://www.kousenit.com ), i have a graph from the job search site indeed.com, which lets you search on keywords in job descriptions. it shows ruby on rails as a rocket that took off in 2005 that has been slowly descending ever since. on the same historical graph, grails is like the tide coming in, slow and steady. more and more people are using it, but at the moment not quite enough to keep me busy full time. i think that’s going to change this year, though. in the meantime, i’ve been teaching lots of courses on spring, hibernate, java web services, web security, ajax, ejb3, and related topics.
adopting a new web framework is a significant decision companies don’t make lightly. i try to tell them that you can add groovy, though, without disrupting your current java development processes too much. plus, you can start with tools, like spock for testing or gradle for builds, that let you use excellent groovy projects without adding groovy to your production code. that message is always well received. of course, i’m not really being honest. adding groovy really will be disruptive, but in a good way.
my calendar tends to fill roughly two months ahead of time. at the moment i’m booking classes into june, and my schedule does include a (private) grails class. i strongly suspect there will be more as the year goes on.
andres: your website mentions you're writing a book about java and groovy. what's the scoop?
ken: the book is called “making java groovy”, and is available at http://manning.com/kousen through the manning early access program. i just turned in a new chapter on using groovy with the spring framework, which should be added to the meap soon. the book is currently past its “first ⅓” review.
here’s the “elevator pitch” for the book: groovy is not intended to replace java -- it makes java better by doing well what java does poorly. adding groovy to java means you don’t lose anything, but you gain a great deal. the goal of the book is to examine all the tasks a typical java developer faces (working with databases, building web applications, creating and running web services, and so on) and seeing how sprinkling in some groovy in the right spots can make your job as a developer much easier. the basic theme of the book is:
java is great for tools, libraries, and infrastructure. groovy is great for everything else.
in case you’re interested, let me tell you a bit about how the book’s history. ultimately, it’s all scott davis’s fault. scott is the indefatigable speaker, trainer, developer, and author of several books, including “groovy recipes”. i was a tech editor on that book (which is another way i learned groovy) and on his gis book as well. i also knew scott as a speaker in the no fluff just stuff series of conferences (nfjs, http://www.nofluffjuststuff.com ), which i used to attend on my own dime. now i’m a speaker on the tour, which is really fun. i love being on the tour and speaking about groovy related topics, from basic groovy/java integration to spock to gradle.
anyway, i met scott at an nfjs conference back in 2007. i’m also an adjunct professor at r.p.i. in hartford, ct ( http://www.rh.edu ), where i teach a graduate class on developing enterprise applications. i wanted to use scott’s “jboss at work” book in my class, which is how i go to know him. like everybody else in the groovy and grails communities, he was extremely kind and helpful about it.
by the late summer of 2008, i’d been a tech editor for pragmatic programmers for several books and had proposed a couple of my own, both of which got turned down. then i got contacted by an editor at o’reilly who said that they had a groovy book being developed but that the author was having trouble finding time to make progress, and was i willing to help out as a co-author? once i found out that the author was scott, i jumped at the chance.
it turned out, however, that scott was living the wild, exciting life of an international java superstar. i imagine you’re familiar with that, too, being a java rock star yourself. the price of fame, i guess. as a result, though, i wound up working on the book a lot more than he did, and eventually he gave the contract to me alone shortly after the springone2gx conference in new orleans. while that was an acknowledgement of his time pressure reality, he gave me this opportunity, and for that i’ll always be grateful. just don’t tell him i said so. i plan to give him a hard time about it into perpetuity.
the thing is, early in 2010, o’reilly did a review of their upcoming catalog and decided to cancel several of their upcoming books, including mine. they claimed there wasn’t a sufficient market for groovy books. seeing as how forbes had just published an article about web development in grails, that seemed a bit of a stretch, but so be it. my plan is for the sales of my book to dazzle them so much they regret ever questioning the market. if my book is the first java/groovy integration book to make the ny times best seller list, so much the better. :)
that might be getting a bit ahead of myself, though. one day a couple months ago i was sitting at the dining room table reading an email from amazon.com listing their highlighted books of the month. i wondered (out loud, unfortunately) how i could get my book on that list, at which point my wife rolled her eyes and said, “write it!” sigh.
after the book was cancelled, i moped around for a month or so, then tried marketing it to other publishers. somebody (oh yeah, it was some guy named andres almiray) gave me the name of an editor at manning, and the rest, shall we say, is history. i’m very happy to be a manning author. the early meap sales are very encouraging, too, which is more evidence that this is the right topic at the right time for a lot of developers.
andres: how do you keep in touch with groovy news and community?
ken: once i found out that most of the members of the core groovy and grails teams were on twitter, i started following them all. that’s been very helpful. i follow several blogs, too, but i find that twitter has really reduced the quantity of blog posts for most people. it certainly has for me. i like burt beckwith’s weekly post on developments in the grails community, and groovymag (another great resource, btw) is now doing the same thing for groovy. of course, i try not to miss glen and sven on the grails podcast. there’s also this dzone thing, too.
paul king (one of the groovy in action co-authors) tends to add fantastic presentations to his slideshare.net account on a regular basis. just assume everything paul king writes is good and you’ll learn plenty.
whenever i have questions on any api in the groovy ecosystem, i find the associated mailing lists to be invaluable. i’ve posted lots of questions on the lists for groovy users, grails users, gradle users, and even spock users, and i always get excellent answers within hours. it’s such a joy working with the people in this community. that’s half the fun for me, actually.
incidentally, that attitude flows from the top down. graeme rocher (head of the grails project) and guillaume laforge (head of the groovy project) are two of the most impressive developers i’ve ever met, and yet they’re both warm and friendly, with a great willingness to help newbies. i’m sure it’s not a coincidence that the rest of the community is that way, too.
andres: what would you like to see in a future release of the groovy language?
ken: generally the groovy core team members are better at coming up with ideas than i am at asking for them. i really liked the ast transformations, like @singleton and @delegate, that were added in 1.6, for example. so i’m sure whatever they’re planning will be cool. i’m much more of a groovy user than someone who works on the language itself, though i like to learn about how it’s done. jeff brown (wicked cool co-author of the second edition of “the definitive guide to grails”) was kind enough to help me make what is probably the tiniest possible commit to the grails codebase, which was great, but i’m mostly content to learn about the new capabilities as they come along. that’s why i like being an instructor. i really enjoy learning about new things, then helping other people understand and use them.
andres: what's on your reading table right now?
ken: now that the spring chapter in my book is done, i’m back to working on the chapter on restful web services and groovy. that’s a chapter i’ve had to rewrite from scratch twice, and now i have to do it again. hopefully the third time will be a charm. every time i think i understand rest, i find i’m not quite there yet. so right now i have both “rest in practice” and “restful java with jax-rs” handy.
incidentally, scott davis gave me a good piece of advice on writing. when i was writing my first chapter, i mentioned in passing that i thought i’d accidentally picked the hardest chapter to work on. he told me, “they’re all the hardest chapter.” :)
speaking of books i’m planning to read, rumor has it that there’s a good book on griffon coming out soon (called “griffon in action”, or something like that). i intend to really dig into that when i get to my chapter on desktop groovy. i also have to find time to read venkat subramaniam’s new book on currency on the jvm. i’m also eager to read each new chapter in the “groovy in action” second edition. i know hamlet d’arcy just added a chapter to that book about ast transformations, which sounds cool.
andres: any parting thoughts you might want to share?
ken: i really like technologies where tasks that used to be hard suddenly become simple. with groovy i’ve had that experience over and over again. groovy is full of “afterthought” innovations that seem blindingly obvious in retrospect (like the safe dereference operator -- obj?.name returns null if obj is null without throwing a nullpointerexception), as well as powerful capabilities like metaprogramming that express themselves in extremely simple ways, like builders and gorm.
if you’re faced with a complicated java development task, consider adding groovy to make the job easier. you don’t have to do much to get a great benefit, and at deploy time, it’s just another jar file.
most of all, if you have a problem, feel free to ask. for a cutting-edge technology representing the combined efforts of some of the greatest developers in the world, groovy is awfully easy to learn, and the people involved are willing to help. feel free to ask me all your hard, multithreaded desktop java questions. i can forward them to andres as easily as the next person.
thank you ken!
Opinions expressed by DZone contributors are their own.