Archive for February, 2008

Ruby on Rails et al.

Saturday, February 23rd, 2008

I am an experienced and competent J2EE developer (with some forays into the updated JavaEE technologies). I have worked with most of the big technologies and acronyms from time to time. They are powerful, very powerful. Howevever, they are also big and cumbersome to learn. For a long time, I have taken the stance that the complexity was necessary. You get robustness, correctness, and big industry names behind your project.

Yet, when I was reading through the spec for the Java Business Integration (JBI) API this past week, I was dumbfounded by some of what I would consider unnecessary complexity. Integrating services across a business should not be that much work. Although I don’t know what specific conclusions can be reached about this fact, t is interesting that BEA and IBM, two big enterprise committee members, decided not to vote for the spec.

In a dramatic departure from my previous stances, I am going to go out on a limb and say that Ruby and Rails maybe is capable of delivering most of what Enterprise Java is actually used for and at a dramatic savings in time. I have been reading up on the framework, and I have been very impressed by the power of the conventions-based framework. I see concise, understandable code and lots of freebies. I understand and sympathize with some of the pedantic arguments against Rails. However, that those concerns don’t seem to actually exist as real issues with most real Rails projects indicates to me that most developers who think they are doing Enterprise development actually aren’t.

The features are compelling. You want persistence and you get ActiveRecord. You want MVC and you get a convention-based file/folder and class structure that outlines the distinct responsibilities of the code. You want web services and you get to choose between REST and SOAP (with the simplicity of REST being preferred). You want transactions and you get to choose between service-like transactions that can roll back database state or Object-based transactions that roll back database AND object state. Scalability is all about load balancing your server tiers.

Listen, I don’t think I am ready to be a Ruby on Rails evangelist, but I can’t help but wonder why some of the commercial projects I have worked on have not employed it.

For those who aren’t ready to throw away all their Java infrastructure, I am very impressed with the Grails framework as well.

Spring Tip - PropertyPathFactoryBean

Wednesday, February 13th, 2008

I love the Spring Inversion of Control framework, mainly because every time I think it should do something, I find out that it does.  I came across a situation today where I needed to make use of the value of a property as the basis for a setter on a bean.  Really, what I needed was a way to copy a property from one bean to a property of another bean.   I found that I could use PropertyPathFactoryBean to create a bean with an ID of bean.propertyName and a class of PropertyPathFactoryBean.  When that bean was passed in to a setter in the destination object, the typing was seamlessly handled.

Maybe knowing a specific use case would make the power of this all the more obvious.  What I was trying to do was set a URL on a business domain bean to a URL derived by calling getURL() on a bean that implemented the Spring Resource interface.  I want to keep my domain objects free from any Spring API dependencies, and this approach allowed me to use the power of the Resource interface (and the various provided Spring implementations) without making my code dependent on Spring.  All the power, none of the baggage!

Super Lame Tuesday

Tuesday, February 5th, 2008

Super Tuesday is about the biggest non-issue of my week. Although the Kansas Democratic Party is holding their caucus today, that doesn’t impact me because I am one of the Other Guys. Republican? Yes, on paper. However, the only Republican candidate that I could actually see myself getting behind in this upcoming election is Ron Paul. Unfortunately, by the time the Republicans cast their votes in the Kansas caucuses, all the front runners will be pretty much set.

If you haven’t heard of Ron Paul, I can’t really blame you. He defies all the worst characteristics of both major political parties and represents the best ideals of both. What is it that both parties abhor? He believes in small government. The Republicans can’t stand that he might threaten their unconstitutional power-grabbing in the name of national security. The Democrats are terrified that he might eliminate all their precious and equally unconstitutional federal programs that rehabilitate alcoholic yaks, provide free condoms to elementary school students, and ensure that no art museum is without plenty of abstract nude paintings.

Critics would say a vote for Ron Paul is a throwaway vote. At least I could sleep with a clear conscience afterward.

Maybe it’ll catch on this time

Tuesday, February 5th, 2008

I have tried starting a blog several times before, but I have never really been able to keep it up.  Maybe this is the time.  Or not.  But I am trying a few new things.  Previously, I tried the WordPress blog engine that came installed with my web hosting package.  It was pretty limited in functionality.  Of course, being the geek that I am, I thought it would be a good idea to code out my own XHTML, build my own database schema, write my own blog management interface, etc.  Okay, that was dumb.  So now I have installed the latest and greatest WordPress myself from the tarball.  Now, I am not pulling out my hair about configuration and code I can’t modify, but I am not writing my own blog engine either.  This should do nicely.