AppFuse Review
Monday 5 December 2005 @ 12:49 pm
Filed under:

I did a short investigation into the AppFuse project, to establish if this is a tool Consultants working for the LogicaCMG Java Competence Center can use in their projects.

What is AppFuse?

AppFuse is an application for “kickstarting” J2EE web application development. It consists of a set of libraries, jsp’s, templates and several build scripts. Running the ant new target in the AppFuse root directory will prompt for a few parameters of the target application, like database and package names. AppFuse then generates and copies a deployable web application that can serve as a starting point for further application development.

How well does AppFuse work in practice?

To find out how well AppFuse really works, I followed the QuickStart Guide, the Creating new DAOs and Objects in AppFuse, the Creating new Managers, the Creating Spring Controllers and JSPs and the Adding Validation and List Screen tutorials. I then tried to port the generated code to another RDBMS (Cloudscape 10.1). I also had a go at replacing the default two column page design with a three column design.

These are my findings.


  • Short startup time - I had a deployable, database driven, tested, 3-Tier J2EE application supporting authentication, authorization, logging, click through tracing etc. in less than 3 hours. Even taken into account that I already had a complete Java environment installed on my machine (JDK, Eclipse, MySQL, Ant), this is fast … very fast.
  • Choose between IBatis and Hibernate - for persistence, AppFuse lets you chose between a DAO layer implemented using IBatis or Hibernate.
  • Choose between Spring MVC, Tapestry, Webwork orJSF - for the Web Tier, you can chose between two Component based (Tapestry and JSF) or two Request based web frameworks (Spring MVC, Webwork).
  • Support for Test Driven Development- apart from DAO, Manager and Web classes, AppFuse also generates Test Cases and the ant targets to run them, either individually or in logical groups (test-dao, test-web, etc.).
  • Build script - the Ant build script consists of 1200 lines and 65 targets and covers everything from dropping, creating and populating the database to deploying to Tomcat and fixing CRLF for Unix Machines.
  • Integration with Sitemesh - the JSP’s are build up using the the Sitemesh templating library, providing for clean separation between content and layout directives. Compared to for instance Tiles, Sitemesh is more powerfull and flexible.
  • Released under the Apache License - it lets us freely use the software for company internal and commercial purposes and does not require us to submit changes that we make to the software back to the Apache Software Foundation.
  • Documentation and community support - the tutorials and JavaDoc are quite good, and there is an active developer community using the software.


  • MySQL only - the generated code is targeted at the MySQL database system. AppFuse does not support other RDBMS out of the box - manual adaptations of the generated code are necessary to achieve this.
  • No clean dependency management - AppFuse relies on ant build scripts and properties files to configure its (50+) dependencies. Usage of a tool like Ivy, a simple to use but powerfull dependency manager would be nice instead.
  • Heavy reliance on XDoclet for code generation - this leads to code that belongs in the Integration Layer (i.e. Hibernate mapping definitions and column names) being part of the Domain Layer.
  • Large build scripts - although they do provide a lot of functionality, the large build scripts are difficult to understand and maintain. It is also not always clear what the different targets do and how they depend on each other.
  • Usage of Business Keys as PKs - in general, when using Hibernate, it is a best practice to use Surrogate Keys as PKs for database tables representing Business Objects (”User”, “Car” etc.). AppFuse ignores this and uses the Business Keys as PKs.
  • Small committer base - it is unclear to me how large the developer base is that actively maintains and develops the AppFuse project. This is something to investigate when planning any long running projects.


AppFuse does what it promises to do, which is always nice: it kick starts a J2EE project in a very short period of time. In my opinion, this makes it a very good tool for Consultants that are assigned to small to medium sized, Proof of Concept like projects. Here AppFuse really shines and should be used to its full extent, meaning including all XDoclet code generation features and ant targets.

For larger projects, that will be running over longer periods of time, that have to integrate with other RDBMS like Oracle and need a clean dependency management, AppFuse can serve as a starting point. In that case though, one really has to invest the time to refactor the generated code.

— By Thomas Delnoij     PermaLink

5 Responses to “AppFuse Review”

  1. Matt Raible Says:

    I’d love to hear about the issues you’ve had with Cloudscape. AppFuse work’s out-of-the-box (no code changes) with most popular databases. I routinely switch between MySQL and PosgreSQL, and there’s instructions on the wiki for Oracle, DB2 and SQL Server. I’ve used everything but DB2 in production applications.

    Thanks for the review!

  2. Matt Raible Says:

    Doh, I meant to say “everything but SQL Server”, I used DB2 quite a bit last year. As far as no clean dependency management, I hope to use Maven 2’s Ant Tasks for that, and I’ll probably change the business keys in the near future. The reason it currently uses business keys was to make integration with Container Managed Authentication easier. We’ve only recently integrated Acegi Security.

  3. Thomas Delnoij Says:

    Before porting the application to Cloudscape 10.1, I looked at the AppFuseOnDB2 tutorial, which is great BTW, as are all other tutorials. The issues I ran into were minor, for instance adapting the SQL queries in the applicationContext-security.xml file. This in all took me about 2 hours. But although the code compiled without problems, and the tests also ran without any errors, I wasn’t able to login to the application. I investigated this problem for another hour, and left it at that.

    So although deploying the AppFuse generated app on MySQL worked within 3 hours for me, porting the app to another RDBMS takes more time. One either has to work through another tutorial, and/more make some more undocumented changes. IMO this cannot be called “out of the box” functionality anymore.

  4. Paul White Says:

    My first experience with appFuse has been in a position where I am taking over support of an existing application written using struts, hibernate and spring. Now perhaps appFuse did allow the original developer to get into these technologies and get an app up and running in a short time.

    However what I am now left with does not impress me. There is massive over-reliance on xdoclet. For example the struts-config.xml is built from xdoclet comments in java classes. I dont see the benefit of this and it just leads to confusion. For example looking in the struts config I saw the same action path pointing to different java action classes. This was caused by the original developer putting xdoclet tags to the same path in different java classes. xdoclet is used all over the place to build forms etc. The build.xml is enormous and very hard to follow. There are numerous properties files, some of which are created dynamically from other properties files. The upshot of all this is that the build time is ridiculously high and unacceptable during the development phase. My build time has been as high as 29 minutes for a change to a single java class! By way of comparison, I am also working on a similar sized webapp project using all the same technologies (apart from spring) built and deployed using eclipse (i.e. no ant file needed). I would expect a similar change in that non-appfuse environment that I just described to ripple through to the deployed app in about 5 seconds rather than anything up to 29 mins. Thats a massive difference.

    My plan for my appfuse built project is now to remove the unnecessary xdoclet and rewrite the build.xml in an attempt to obtain a simple, understandable build script that above all builds fast.

  5. Quayum Sagri Says:

    Thomas Delnoij wrote:
    AppFuse also generates Test Cases and the ant targets to run them.
    Is it stated in its true meaning. if so how does it generate. I did not find an interface to do that.

    Why does appFuse uses only jMock?
    Why not strutstestcases, springframework.test or any other implementation of junit, though they are made for the use with appropriate framework.

Leave a Reply


Sha256 mining

Blog Categories

Browse by Date
December 2005

Upcoming Events

Monthly Archives

Recent Comments


XML Feeds Option

Get Firefox  Powered by WordPress

code validations
Valid RSS 2.0  Valid Atom 0.3
Valid W3C XHTML 1.0  Valid W3C CSS