Klikk på tall for å vise stripe
Toon 1Toon 2Toon 3Toon 4Toon 5Toon 6Toon 7Toon 8Toon 9Toon 10 JavaZone JavaZone

Groovy, The Red Pill: The Groovy Way to Blow a Buttoned-Down Java Developer's Mind

dc7e58b1-017c-4cb3-b942-18305dd59a92
View video  Presentation
This talk focuses on the ways that Groovy can turn a traditional Java developer's world-view upside down.
Summary
We'll start by talking about how you can thumb your nose at The Man by leaving out many of the main syntactic hallmarks of Java: semicolons, parentheses, return statements, type declarations (aka duck-typing), even try/catch blocks. Of course, there's no way that we'd leave metaprogramming out of the discussion...
What is metaprogramming? We'll add new methods to classes at runtime -- even if they were originally implemented in Java; even if they were declared final. (Thanks, ExpandoMetaClass!) We'll call methods that don't exist and avoid the dreaded MethodNotFound Exception. (Thanks, invokeMethod!) We'll narrowly scope our metaprogramming shenanigans using Use blocks and Categories, and then cast our changes to the wind such that every instance of a class gets our added juice.
If you are happy taking the Blue Pill, this talk is not for you. You can continue using Groovy as a slimmed-down dialect of Java -- an "After" picture to Java's "Before". If, however, the Red Pill looks interesting, please join me. Remember, all I'm offering is the truth. Nothing more.
Expected audience:
This session is aimed squarely at Java developers. The more experience you have, the better, but even neophytes will appreciate what Groovy offers Java developers. Experience with other dynamic languages like Ruby, JavaScript, or Python will help, but certainly isn't required.
Required experience:
You should be comfortable with the basic syntactic rules of Java (so that we can mercilessly squash them). You should understand the basic "Laws of Java" when it comes to the semantics of a statically typed language (so that we can kick sand in its face). Most importantly, you should posses an open mind and a belly full of Dynamic-language KoolAid. This is not the forum for someone to vocally defend the merits of checked exceptions and static typing. You will be unceremoniously tossed out on your ear, Jerry Springer-style. Seriously. I'm not trying to convince you that this is the way you should write Java. The status quo can defend itself quite nicely, thank you very much. I'm here to show you how your code could look, if you so desire.
  • Photo of Scott Davis
    Scott Davis
    Scott Davis is an internationally recognized author and speaker. He is passionate about open source solutions and agile development. He has worked on a variety of Java platforms, from J2EE to J2SE to J2ME (sometimes all on the same project).
    Scott's books include Groovy Recipes: Greasing the Wheels of Java, GIS for Web Developers: Adding Where to Your Web Applications, The Google Maps API, and JBoss At Work.
    Scott is the Editor in Chief of aboutGroovy.com, a news and information website that tracks the latest developments in Groovy and Grails. He also writes a regular column for IBM DeveloperWorks -- Mastering Grails.
    Scott is a frequent presenter at national conferences (such as No Fluff, Just Stuff) and local user groups. He was the president of the Denver Java Users Group in 2003 when it was voted one of the top-ten JUGs in North America. After a quick move north, he is currently active in the leadership of the Boulder Java Users Group. Keep up with him at http://www.davisworld.org