A Zen gay Texan’s perspective

Time for another geek out session. ;-) Well, ok, I’m whipping out a new acronym. In the world of technology, it’s a lonely place for acronyms (yeah, right!). I actually haven’t seen this in use anywhere, I guess because it already stands for something else. SSH as any tech head knows is secure shell, a secure telnet way to interface with a remote system via command line.

But in the Java world, SSH stands for (well, ok, only in MY Java world): Struts, Spring and Hibernate. A complementary set of OSS (Open Source Software) frameworks that are in popular use on many applications. While Sun, the controllers and champions of Java stand solely behind J2EE, there are many shortcomings as experts in the field will tell you (excellent article and included free chapter of the book by Rod Johnson, which I intend to get soon). Thus, many frameworks were born to fill in the holes.

What I’ve seen in popular use (and we’re beginning to use on our application as we migrate to a J2EE-based architecture), is Struts, Spring, and Hibernate. Struts I’ve used for while, the other two frameworks are much newer to me. The three frameworks work well together, and provide robust frameworks for the three tiers of a classic n-tier application: presentation, business, and domain/data tiers.

Struts is an MVC framework (Model/View/Controller pattern) which handles user requests and separates controlling the user experience from the data being managed by the system (the model) as well as from how it is viewed and how they interact with it (the view). It fits naturally within a J2EE web container and JSPs. The Struts tag libraries along with JSTL tag libraries allow front end developers to easily and quickly develop JSPs which interact with views, forms and domain objects. What I love about Struts and I consider a sign of any good framework, is it makes it easiest to code the RIGHT way within it, separating concerns and focusing on the UI in Struts classes (user flow, i18n/l10n issues, messages, etc.)

Spring is a great, robust framework. It can actually provide the nuts and bolts of your application framework from top to bottom. It could virtually be called a J2EE replacement, though that is blasphemy amongst many in the Java community I’m sure. It seems that their MVC framework is robust, though the most popular use (and how I like using it), is their IoC (Inversion of Control) container which wires together business components. It’s an easy fit here where we’re moving from ATG Dynamo. ATG provides the Nucleus, a very similar concept. It’s a shame with ATG’s situation, they have such great frameworks (and they came up with them years ago) that in fact many copied them. Unfortunately when the copies became popular, ATG remained proprietary rather than suck it up and make their frameworks compatible with the copies. Such is life. The dependency injection allows you to easily connect business components, and what I really like is the ease with which test classes can be substituted for downstream components. Not that we’ve been very good at that yet here with our use of Spring, but it’s on my radar.

Finally is Hibernate. We’re just starting to look at it and I’m not an expert by a long stretch. But the buzz is good as well as internal feedback so far. It’s an OR Mapping (Object/Relational Mapping) framework which maps OOP (Object Oriented Programming – see, told you we techies love acronyms) to an RDBMS (Relational Database Management System). In other words, it easily syncs up nice easy to use Java objects with DB tables. Now why didn’t I just say that? The mapping looks straightforward and very non-intrusive.

In any Java web-based application, especially those intended to scale, I highly recommend these frameworks as they solve so many problems for you, are easy to understand and implement (and code correctly), and have a wide following in the real world meaning lots of thorough vetting of them to get rid of problems and tons of documentation. My biggest beef these last few years using a niche app server like ATG is doing a search for help on Google about an issue. Type in any set of Java related search terms and you’ll get thousands of results. Just add ATG Dynamo to it or something similar and the results drop down to less than 100, or even 10 in some cases (no joke!).

June 23rd, 2006 at 2:02 pm