Code Generation STILL in Action 1

Posted by Steve Longdo Sat, 17 Feb 2007 15:30:00 GMT

The Past

Jack Herrington wrote a book Code Generation in Action way back in 2003. It took advantage of the little programming language that could, Ruby. I remember having a discussion with a colleague back then about the value of generated code. We were of the opinion then that it would only apply to simple repetitive cases and wouldn’t make much of an impact.

If only I could go back in time and slap both myself and my colleague in the face! We missed out on being early adopters of time saving technology. In fact almost everyone using Java was already taking advantage of code generation whether they realized it or not , Eclipse would generate getters and setters and had its refactoring capabilities, Spring was beginning to handle externalizing dependencies, and the then fledgling Hibernate Framework was manipulating bytecode to enhance Java methods.

At the same time my colleague and I were hammering out code with the tried and true cut-n-rape technique that had been popular since before we were born.

Modern Day

I have the “opportunity” to work on porting some old JSPs which, in true 20th century Model 1 style, link directly to each other and the database via scriptlets, to a more modern Java MVC framework. Rather than just wade in blindly, manually translating JSP scriptlet page to Java MVC framework code, I decided to make the project interesting and have been writing a Ruby JSP parser/code generator. It can identify scriptlet code and extract it for me. I have been enhancing the parser to handle generation of Spring MVC code and am working on having it generate Spring Web Flow flows from reading the form action attributes in the JSPs to model application flows.

Here is a 2006 appearance by Jack Herrington at Google on the subject of Code Generation that is worth a watch.

ActiveMessaging is still alive...

Posted by Steve Longdo Thu, 04 Jan 2007 20:49:00 GMT

I am happy to see that ActiveMessaging (a13g<-corny) is returning to life. It was announced with a bit of fanfare by Obie in early 2006 and then disappeared.

Jon Tirsen sent out some invites for a new Google Group and introduced Andrew Kuklewicz as the new maintainer of the project. I think this will become the premier way for RoR apps to interact with Java backends in 2007. Take a look at the code and see how you can contribute!

Liquid Templates and Mephisto... 1

Posted by Steve Longdo Thu, 30 Nov 2006 21:21:00 GMT

I am done with Liquid Templates. I grasp the idea of “user” editable code that is “safe”, but I don’t want to spend my time programming with it. Having spent time with Mephisto and working through the leakiness of the Liquid Template abstraction, I now have an even greater appreciation for coding templates directly in Ruby.

This just confirms the wisdom of prophet DHH about “The false promise of template languages”. <-That was posted back on Valentine’s Day 2005!

I am not a designer (INAD?) so why would I choose a blogging engine that doesn’t cater to me as a programmer? As a programmer, using Liquid is the equivalent to having to wear a condom, all the time. I want the full Ruby sensation, thanks!

Older posts: 1 2 3 ... 7