|  About  |  Archives  |  Log in  | 

Archive for April, 2004

SWE Processes

Yesterday, I did a brief presentation on software development processes for the Knowledge Management Research Unit. After the presentation; I was asked if I could gather some links to additional information. This I did and I have decided to post the brief list, I ended up with, here:

  • My presentation
  • Scrum @

    WikiWikiWeb - a self organizing
    definition / discussion of scrum.

  • "Official" scrum website,
    containing a general description of the process. I lifted some of the pictures in my presentation from this website.
  • Thorough walkthrough of scrum elements here.
  • Jeff Sutherland describes experiences with using scrum in this Cutter IT Journal theme issue(december 2001,
    vol. 14, No. 12) on software methodologies
  • PDF document, which describe iterative software development (including agile processes).
  • PDF document containing an excerpt from a book on scrum.
  • Interesting blog
    on scrum - includes some considerations of the inherent qualities of software and some management perspectives.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Struts string format

I recently discovered that Struts is able to format strings in a most convenient way. Say you have some bean class (ie. Order) in your application and wants to print the attribute values of an instance of that class (ie. orderObj) in a .jsp page. To do this, you set the class instance as either a request or session attribute and use the struts bean taglib to write out the attribute values:

Order Date:
<bean:write name="orderObj" property="orderDate"/>

Now, when struts write out these attributes values, each value is converted to a java.lang.String using the toString() method of the attribute class. So if the OrderClass.orderDate attribute is of type java.util.Date, the following output will be generated:

Order Date:
Mon Apr 12 10:30:10 CST 2004

Which is in the default format (dow mon dd hh:mm:ss zzz yyyy) used by the java.util.Date.toString() method.

Often, however, it is nice to be able to use a custom date (or time) format for printing time stamps. J2SE offers the java.text.SimpleDateFormat class for formatting dates, but using an instance of this class quickly becomes tiresome: The nice thing about the default output is, that it is specific to the brower's locale settings; to maintain this aspect, the SimpleDateFormat instance must either be available on every .jsp page, or have the client locale included with every format request (if not, the formatting will be based upon server locale).

Luckily, the struts bean taglib enables this sort of customization - it just took me a while to discover it :)

Here's how:

The <bean:write> tag used above can include formatting information, by using either the format or formatKey properties. Using the format property, a custom format can be stated directly:

Order Date:
<bean:write name="orderObj" property="orderDate" format="EEE, MMM d, 'yy"/>

Will generate:

Order Date:
Mon, Apr 12, '04

Please see the J2SE API spcification for information on format strings. If you want to different formats for different locales, you can use the formatKey property, which refers to an application resource bundle (see this for information on using message resources with struts). In the message property file(s), you define the locale specific formats:

In resources.properties (default locale):


format.date.short=MM-dd-yyyy
format.date.long=EEEEE,  MMMMM d. '&nbsp;@'HH:mm

In resources_da.properties (another locale):


format.date.short=dd-MM-yyyy
format.date.long=EEEEE 'd.' d. MMMMM '&nbsp;kl.' HH:mm

The formats are then used in the bean tags:

Order Date:
<bean:write name="orderObj" property="orderDate" formatKey="format.date.long"/>

Which will generate output based upon the given format and the browser's locale:

Order Date:
Monday, April 12. @10:30

Which is nice….

If you enjoyed this post, make sure you subscribe to my RSS feed!

Setup

I have been doing some work on the Ibatis sql maps, setting up caches for query results and defining some dynamic statements. I have not used the dynamic statements before, but found this feature to be very useful. In short, a dynamic statement can contain comparisons, which check the arguments of the statement and modify the resulting SQL query. So far, I have found that using dynamic statements minimize the number of queries in the sql maps, since several, similar statements can be defined using just one dynamic statement.
This reminds me that I made a mental note to post something about the basic setup of this application and
gersbo.net

. The

gersboweb

application is deployed on a Tomcat servlet container, using an Apache web server instance as proxy. The dynamic content of the application is stored in a Postgresql relational database.
The application itself is a J2EE web app, which uses the Struts MVC application framework. The reference to the sql maps refers to the Ibatis data abstraction layer, which I use for the interaction between the application and the postgresql database.

I have been using (and use) several tools to develop the
gersboweb

application. As a possible inspiration to others and to give due credit to the tool makers, I think I should mention the list of tools:

  • The JetBeans IntelliJ IDEA IDE is versatile and easy configurable IDE for Java applications. I really cannot recommend it enough.
  • TextPad editor is a powerful text editor. You can download definition files for syntaxes, spell checking etc. at the TextPad website.
  • DBManager Professional 2.2.0 by DBTools Software is a free management tool for the Mysql and Postgresql database systems.
  • DbVisualizer from Minq software is a JDBC based database management tool (Minq used to have a free (w. limited functionality) edition available at their website, but I cannot seem to find it these days).
  • I use the Zaval JRC Editor to maintain files containing locale specific resources.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Resource links

A few links to servlet/JSP resources:

Interesting:

Practical:

  • murl.com - a possible
    gersboweb

    feature?

If you enjoyed this post, make sure you subscribe to my RSS feed!