Tuesday, December 20, 2005

Simply Confusing

Any medium+ size application is going to call for quite a number of objects (java, jsp, css, etc, etc) to fit together to get a job done. While it may be the complex algoryhtm that you developed that you put the most pride in - it's well worth taking a step back and making sure the simple names of your objects make sense. Doing so (as discussed in Sun's code conventions) can make things a bit more clear during initial development, but can pay great dividends during support.

An example. I recently worked on an application where the user signs in - selects what "org level" they would like to work with (unless they only are authorized to one) and is presented with the data (items) for that org level. Very common.

This process involved the following jsps: home.jsp, login.jsp, welcome.jsp

To determine how those work together you'd have to get into the Struts config... Checkout some Java code... Checkout some of the form tags in the jsps... This isn't difficult work but it definitely is frustrating when you're thinking: "I shouldn't have to do this".

How about the following changes:
home.jsp -> welcome.jsp
welcome.jsp -> orgLevelNavigation.jsp
login.jsp -> baseDataEntry.jsp

Now (hopefully) you can anticipate:
  • welcome.jsp is the first screen: greet the user and provide some basic instructions, etc.

  • orgLevelNavigation.jsp is a screen that will help guide the user to their desired org level.

  • baseDataEntry.jsp turned out to be a screen that actually had nothing to do with someone logging in. Go figure.

... and I'll spare you what the Java objects supporting this project looked like!

0 Comments:

Post a Comment

<< Home