Back

TechnologyDec 12, 2008

The Quickest Way to Get a Robust Java Application Running

Credera Team

When developing an open source Java based web application there is frequently a great deal of work involved just to get your environment up and running. First of all the tools need to be selected, based on your requirements and preferences. At a minimum a robust website will require a place to store data (likely a database). Next, decisions will need to be made in regards to development frameworks followed by persistence layer, testing, and logging tools.

All of these choices can lead decision makers to software solutions that require fewer configurations. Previously PHP might have been chosen over a java/jsp solution. That trend has started to shift to Ruby on Rails in recent years.

In order to promote Java based web development to clients or for in house projects, the setup and configuration needs to streamlined and automated. Once this can be accomplished it will allow development to start sooner.

A few months ago I stumbled on a great open source project which provides an excellent solution for just these problems. The project named AppFuse, was started by Matt Raible. It follows a convention over configuration philosophy. In order to get a project up and running a few decisions are made (ie: database, framework, persistence layer). This project then relies on a myriad of open source projects that complement each other well. Most of these projects are heavily used in the Java world and some are the de facto standard.

For some insight on setting up a project with AppFuse please visit the Quick Start Guide. Below is a synopsis of how to get started.

  1. Required Downloads

    • Java (obviously)

    • Maven

    • Database (like MySQL)

    • Eclipse, IDEA, or NetBeans

  2. Follow the configuration settings

  3. Install optional tools

  4. Create a project

    • Run a maven command mvn archetype:create (followed by archetype parameters)

  5. Run your application Customize your application (Introduce business logic)

After step 5 above, the website is fully operational with a role based security layer that allows for user management and user self registration. At this point the website is operational quicker than a Ruby on Rails app. The customization still takes longer than Ruby on Rails scaffolding, but the conventions are provided and keep the development time closer.

The tool that speeds up most of the environment setup is Maven. AppFuse has just started utilizing Maven as of the 2.0 release. If you are unfamiliar with this tool it is well worth checking out the Maven Site. I would liken it to Ant on steroids.

The following is a list of technologies utilized in an AppFuse project.

Apache Commons

Junit

JMock

Spring

Struts

Hiberate/iBatis/JPA

Canoo Webtest

Displaytag

OpenSymphony

Jetty

JSF/Struts/SpringMVC…

Annotations

Cargo

Even if there are different tools and projects that you would like to use on your projects, AppFuse provides ideas for a blueprint by which all projects can be developed. Simply by setting up Maven properly and developing a set of convenience classes and tag libraries, projects can be set up quickly with little configuration. This allows most of the development time to be spent on building the business logic, thus increasing developer productivity.