Sunday, November 22, 2009

No Fluff Just Stuff, Fall 2009

Another year, another NFJS behind me. You would think by now it would be old hat, but it seems like every time I attend, by the end of the weekend, I feel reenergized and ready to crank on some more code. My LOTTD also seems to get a lot longer!

Jay Zimmerman, the founder of No Fluff, just gets it and always manages to put together the perfect geek conference. The speakers are top notch, the topics are relevant, and the food is great. This year, the wireless networking was top notch as well!

Before I get into the sessions I attended, I want to go into one of the less tangible benefits of the conference that folks thinking of attending may not think of, which is the networking opportunities. My weekend started with lunch with some friends, one who is a speaker, prior to the start of the conference. While we don't focus our conversations exclusively on technical topics, they tend to dominate. In this case, I learned a lot about GIS that I was not aware of before.

Similar things happened during conference meals. The speakers are great for mingling, rather than being clickish, and again the discussions were very informative. One of the memes this year was whether speakers should use live coding or pre-recorded demos in their talks. The two camps had strong opinions on the issue and there was a lot of friendly ribbing that went on between them.

Personally, I got to see the good and bad for both approaches. In one talk, the speaker found that some web services APIs provided by Yahoo! he wanted to demonstrate had changed, which broke his demo. He was a bit embarrassed by this and it is possible that some folks in the session were unhappy, but I felt that most attendees were very engaged and it became a group debugging sessions, which in itself is a great learning experience. In another session that used live coding, a question from the audience sent the talk in a slightly different direction. Had the demo been canned, this would have been harder to do.

On the other side though, one of the speaker's Mac crashed right before he was scheduled to talk. Because his talks were canned, he was able to borrow a laptop and go through his talk without missing a beat. If he would have needed to install all of the tools used in his demo, it would have been a massive FAIL.

Jay summarized the debate saying if everyone agreed, someone would be redundant!

And now a summary of the talks I attended...

Spring 3, Groovier Spring - It has been a couple of years since I attended a Scott Leberknight talk. He has kept his tech edge and did great job of reviewing some cool features in Spring 3 (and some lesser known features from Spring 2.5). I'm not a Spring power user, but have some grand plans for incorporating Spring into the product I am currently working on. The plan is to use Spring Dependency Injection to allow third parties to extend the product without the need to access our source code. None of the features discussed in the talk seemed to add any capabilities that I would immediately need for this. My biggest take away is that the Spring platform is very powerful, but borders on being overly complex as well.

That being said, there are some cool features available in Spring. Annotations seem to have taken the place of most XML config. In general, I like this. Spring has added extensive support for ReSTful web services, including a work-around for the fact that browsers do not support the PUT and DELETE primitives. Spring has great support for TDD, including Junit 3 and 4 as well as TestNG. Transactional processing support is extensive, again the idiomatic use appears to be via annotations. The other big take away from this talk was that you can add a global exception handler to a Spring-based system.

Scott also presented information on a groovier Spring. I like Scott's definition of Groovy...

"Java minus all the code I don't like writing plus closures, metaprogramming and more."

SpringSource acquired G2One last year (SpringSource has since been acquired by VMWare). Based upon the first acquisition, a lot of folks felt that Groovy (and Grails) would get baked into Spring. These people were correct! Spring now has a a script factory object that supports beanshell, jruby, and for the purposes of this talk, groovy. Scott presented great examples of how to incorporate groovy scripts that can be run by the Spring app. There are several (too many?) mechanisms that can be used to do this. Fortunately, one of them appears to be the most straightforward. There are some security issues that need to be accounted for if you want to use this mechanism. In one example, the script is pulled out of a DB. Injection attack anyone?

Scott likes to open his talks with a joke, typically some kind of pun. This time, he started with an oldie, but a goodie. What is the object oriented approach to getting rich? Inheritance! But someone in the audience threw a curve ball I had not heard before... Marry a rich Singleton. LMAO!

Grails w/o GORM and ReSTful Grails - Scott Davis, the person who introduced me to Groovy and Grails, did a great job on these two complimentary talks. Both talks focused on using ReST in Grails, but from different perspectives. The first talk was about how to consume ReSTful web services. Scott demonstrated accessing Twitter, Yahoo Search, and a GIS web service from within a Grails application. The code to do this was surprisingly simple.

From the other side, Scott demonstrated how to build a Grails application that exposes a ReSTful web service. His focus in this talk was that while the UI is important, don't forget the data! As expected, it is very straightforward to implement a ReSTful interface in Grails. It turns out that there is a bit of boilerplate involved, so Scott recommends moving much of this to template functions.

I blogged about ReST last year. It is really taking off as the web service technology of choice. Scott compares ReST, which is resource (noun) oriented, to SOAP, which is service (verb) oriented. He presented stats which show that give a choice, consumers of web services overwhelmingly choose ReSTful interfaces to SOAP based ones.

Polyglot Persistence - Another Scott Leberknight talk. There is evidently a movement afoot, the No SQL Movement, which advocates the position that while SQL is not Evil, it is often not appropriate. In this talk, Scott presented some potential alternatives to the traditional RDBMS. These include document-based (CouchDB and Amazon SimpleDB), hash table (Project Voldemort), and big table (Google Big Table and Apache HBase) approaches.

I'm not a persistence guy. Most of my experience is with some simple Hibernate apps and GORM in Grails. It was great to see what else is out there, but my biggest take away from the talk is I'm not smart enough to work at Google. That Big Table stuff is pretty deep!

Git - Matthew McCullough has been on the No Fluff circuit for about a year and is really making his mark. He is a great speaker and really knows his stuff. He is also the speaker who had to recover from a crashed Mac.

Git is a distributed version control system written by Linus Torvalds of Linux fame that is quickly becoming the VCS all the cool kids are using. While an argument could possibly be made that some of this is hype, I think there is enough value add to the product that the hype is justified. In my case, the value is the ability to have the entire repository stored locally on my box, allowing me to work offline and still have access to the entire history. Matthew did a great job demonstrating how to use the Subversion to Git gateway. I am looking forward to trying this out.

The syntax is a bit quirky, as might be expected from the inventor of Linux, but it is easy to do the simple things and possible to do some powerful things!

Open Source Debugging Tools - Matthew provided a whirlwind tour of a dozen tools for debugging Java applications and another dozen or so tools for debugging web apps.

In the Java space, he provided summaries of tools for process debugging, stack and heap dump analysis, disassembly and decompilation. One of the tools that really excited me was the Eclipse TPTP comprehension tool. This tool monitors program execution and creates UML sequence diagrams that reflect the actual execution of the program. This tool can even show execution of dynamic methods created in Groovy objects. I asked about tying this tool into a CI server for automatic creation of developer documentation. The product is not there yet, but I can see this happening in the future.

In the web app space, the tools of note (for me) were curl, firebug, and firebug lite. I hope to find some time to learn these better. Matthew made the point that many developers find System.out.println to be the end all and be all of debugging. I definitely don't want to be in that camp!

Refactoring - Neal Ford has been a mainstay on the No Fluff tour since I have been attending (4 years now!). He often focuses more on the bigger picture of software development as opposed to specific technologies. This talk fits this description really well. Some of this was review from what I had learned reading the seminal refactoring book by Fowler, but there were a couple of good take aways from the talk.

Prior to refactoring, all that you typically have is piles of undifferentiated code. Following the techniques Neal presented, including the composed method and template patterns, will result in code that is more extensive and maintainable.

One soundbite I took from the talk was "It is OK for the framework to know about your code, but your code should not know about the framework".

Collections - This session was presented by Ted Neward, master of everything low level on the JVM (other stuff as well). I have been using java.util.* collections quite a bit lately. I have been frustrated by the lack of some seemingly obvious features, such as creating a list from an array. I went to this class to see if I was missing something. To some extent, I was. The Collections and Arrays classes have some of the features I was looking for, albeit with some warts that still make them less useful than they could be. And some features are still missing (I cannot directly create a List from a List). One take away from the class is I need to go look at Commons Collections.

Ted joked that every time a Java programmer uses an iterator, a kitten dies. Proper use of collections leads to a more functional programming style. I'm not really a cat person, but don't advocate cruelty either, so I really want to move that direction!

FWIW, closures and Groovy are another means to this end as well. So I'm already on the way.

JMS - Another Ted talk (pun intended). I had some very brief exposure to the JMS messaging bus a couple of years ago, but never got into the details. I try at every No Fluff to get some exposure to a technology or two that I may not necessarily need, but want to have a passing understanding of. So my take away from this session, JMS is a standards-based message passing protocol that handles both point-to-point and pub/sub messaging models. One of the benefits (provider dependent) can be guaranteed delivery. The API has some quirks, but seems pretty straightforward. There are many JMS providers out there. Ted stressed not coding to a specific provider jar, but rather compiling with the jar shipped with the JDK, then deploying with the provider jar to ensure you are adhering to the standard. The biggest disappointment was finding out that JMS messages from one vendor are not typically cross-compatible with other vendors.

So that's a wrap for this year. My head is full, there aren't enough hours in a day, but even with these constraints, I always feel like I have improved as a developer just by attending the show. And after I spend some playing with some code... look out!

I'll close with a teaser. Jay is going to have some really cool news for release in the next couple of week. I'll tweet/blog when he does. I don't want to steal his fire, so until then, I will leave you in suspense!

Sunday, March 08, 2009

Brain Quenched, Actually Soggy to the Point of Leaking.

In my last blog, I suggested that if you wanted to learn Groovy or Grails, that Scott and Andrew at ThirstyHead were the people to talk to. Well, last week I put my money where my mouth was and attended the inaugural class from ThirstyHead, "Advanced Grails", taught by Scott in Lone Tree, CO.

With the exception of a hard drive crash on my part that resulted in switching laptops mid-class, everything went fantastic. I really learned a lot in three short days.

I have extensive experience working at many levels of software development, from writing assembly and embedded C on 8-bit processors, to developing hard real time systems using a commercial RTOS (in C & C++), to multi-threaded Java development. One co-worker recently called me the Swiss army knife of programmers. I really liked that description. But the compliment of tools in this knife is not complete by a long shot and I am always looking to add new ones. Web development is one item lacking from my repertoire. Enter Grails.

A web framework targeted for the JVM, most first reactions tend to be "Hmmm, yet another web framework". The distinction Grails brings to the picture is a framework that embraces convention over configuration, dynamic programming, built-in support for testing, and tools that fit well in an agile shop, all this in a framework that is inherently Java friendly. While there is no arguing with the fact that Grails and it underlying language, Groovy, borrowed a lot of inspiration from the Ruby on Rails framework, it is relevant in its own right due to its strong integration story with Java. For a beginning look at Grails, check out Scott’s Mastering Grails series on IBM DeveloperWorks. There are also some good books out there, Grails in Action and The Definitive Guide to Grails. After you are comfortable with the tutorials, you have the basics under your belt, and you want to move to the next level, Scott’s class should be a prime consideration.

The goal of the class was to do a deep dive into the inner workings of Grails. In Scott’s words, by the end of the class, he wanted us to not only know how to use Grails, but how to make it sing… to a tune of our own selection. I think he got the job done.

We started with a deep dive into skinning a Grails app. Step one was looking at some existing CSS templates that are available via Creative Commons. After choosing one, we learned how to skin our app with it, modify the stock GSP (Groovy Server Pages, similar to Java Server Pages). In true agile fashion (Scott is an expert on Agile development as well), we added a feature at a time, first adding the correct tags and labels to the GSP and then learning how to break it into reusable templates. The View aspect of the MVC pattern is one of the areas I am weak in, so this section was extremely helpful. I will be attending the AJAX spike offered by ThirstyHead in April to further expand my knowledge in this area.

The next section covered Authentication and Authorization in a Grails application. Scott demonstrated, in a remarkably small amount of code, how to roll your own basic A&A module using Grails interceptors. He followed this up by introducing two popular security plugins, Authentication and JSecurity. Authentication looks fairly straightforward and provides some bells and whistles that would require more effort to develop from scratch. JSecurity appeared to be the nuclear option for security, powerful, but complicated.

Scott spent considerable time covering how Grails supports ReSTful web service support, including time spent looking at other ReSTful web sites. In the special case of sites that only provide read access to their data, Scott has coined the term GETful (since the only HTTP verb supported is GET) to describe the interface. ReST is becoming extremely popular due to the ease with which it can be implemented without having to compromise application functionality. Grails makes a ReSTful app very easy to implement.

We then covered several miscellaneous topics, including codec development (allows data conversion services to translate data to and from strings), operator overloading (supplied via Groovy), file upload, supplying syndication services from a site using Atom, indexing using Lucene and Compass, and integrating support for e-mail and JMX monitoring into your application.

We finished up the last day by digging into the details of the Grails build system, which is based on Gant, the Groovy DSL that wraps Ant. In this section, we learned how to extend the build system to perform custom actions during a build (like packaging special files into the jar or war file).

This was a LOT of info to fit into three days. Surprisingly, at no time did I feel that Scott had to rush things and we even had time to take a couple of detours based on questions from the class. The most memorable was when we figured out how the Twitter ReST interface worked. There was ample time to work on the lab exercises, which were written to build upon and reinforce the lecture material. Scott was always available when things went horribly wrong. The labs really brought everything home.

Another cool take away from class was that Scott bundled up all of the code he wrote during his lectures. Most of this code is commented to help remind us what the key points were for that code. This code is going to be a great resource as I start to use the material I learned.

Given what I already knew about Scott, his knowledge of the subject matter, excellent speaking skills, and cool sense of humor, I can’t really say I’m surprised about how well the class went. I’m looking forward to attending the tech spike in April.

If you are in need of a quick jumpstart in any of the topics they offer, try ThirstyHead. You won’t regret it.

Wednesday, January 14, 2009

Quench Your Head's Thirst!

I am pleased to report that a good friend and really smart guy, Scott Davis, has formed a new company, ThirstyHead, with another great industry icon, Andrew Glover.

The company will provide top notch training focused primarily in Groovy and Grails initially, but if I know anything about these guys, we can expect to see other great offerings as well. Besides their excellent knowledge in all things Groovy and Grails, Scott is the GIS guy in the Java circles (he wrote the book!) and Andrew has done some amazing work in Behavior Driven Development (he wrote the code!).

If you have not had the chance to see Scott talk, you are truly missing a great learning opportunity and a fun time. Scott's speaking style is very informal and engaging. He is very passionate about the subjects he talks about and draws extensively from his own experience.

I have only had the opportunity to attend one talk by Andrew, but have listened to many of his podcasts on JavaWorld and read his entertaining Disco Blog. Based upon what I have heard, I think the Davis/Glover partnership will go far.

If you want to quickly bootstrap your understanding of cutting edge technologies that are bringing rapid, dynamic development tools to the Java platform, ThirstyHead is the place to go! I owe a lot professionally to Scott and wish him and Andrew much success in this endeavor!