2       The Birth of AppFuse


In early 2002, I managed to land a contract where I was the lone developer. I was responsible for everything, from gathering requirements to database creation to DHTML on the web front end. While I’d done a lot of front-end work (Struts, HTML, etc.) over the years, the business layer and persistence layer were mostly new to me. So I searched and searched for J2EE patterns to do things the “right way” for my new client. I ended up implementing Business Delegates, DAOs, and ServiceLocators — many of them modeled after J2EE Blueprints. Towards the end of that contract, I was contracted to help write a book on JSP 2.0. The publisher was Wrox Press and the book was Professional JSP 2.0. I volunteered to write two chapters — one on Struts and one on web security. Note: in March 2003, Wrox went out of business and this book eventually became Pro JSP, Third Edition, published by Apress.

2002年初的时候,我得到了一份个人独立开发的合同,我要负责所有的事情,包括从收集需求到数据库创建和编写web前端的DHTML。虽然我做过多年前台的工作(Struts, HTML,等等),但是业务层和数据持久层的很多东西对我来说是不熟悉的。于是我不断的查找各种J2EE模式来以“正确的方法”满足我的新客户。我最终实现了Business Delegates, DAOs, and ServiceLocators –很多J2EE Blueprints中的模型。在那个合同的最后,我被约定去帮助写一本关于JSP2.0的书。出版商是Wrox Press,这本书的名字是Professional JSP 2.0我志愿编写了两章――一章是关于Struts而另一章是关于web安全。

注:在20033月,Wrox 停业,最终该书Apress出版,名为:Pro JSP, Third Edition

When you write a technical book, it’s helpful to use a sample app to demonstrate concepts. I was tired of reading books that had a throwaway sample app, so I wanted to develop something meaningful; something I could use after I was done writing. My initial thoughts were to write an application that would help you get started with Struts, and would use XDoclet to do a lot of the heavy lifting. It also had to have a lot of security features so I could use it for my chapter on web application security. I came up with the name struts-xdoclet and began developing my application.


After a couple of weeks, I decided that “struts-xdoclet” was too hard to say and renamed the project AppFuse. I developed the sample app for my Struts chapter using AppFuse and released it as Struts Resume. After publishing Struts Resume, I needed to extract the resume-specific stuff out of it to revert back to the generic “jumpstart” application I wanted AppFuse to be. It took me almost three months, but I finally released the first official version of AppFuse in April 2003.

过了几周以后,我认为struts-xdoclet这个名字很拗口,于是把项目改名为AppFuse。我为我的Struts章节生成了一个简单的应用并把它作为Struts Resume发布出去。在发布了Struts Resume以后,我刨除了其中和具体相关的东西使它重新成为一般的入门程序,正如我开始设想的那样。它花费了我几乎三个月的时间,但是最终我在20034月发布了AppFuse的第一个正式版本。

Since its initial release, AppFuse has gone through many changes and improvements. Most of the technology decisions were made from experience. It was a pain to keep my ValueObjects (VOs) and ActionForms in sync, so ActionsForms are generated using XDoclet. I found it tedious to write JDBC and more tedious to update SQL and VOs when adding new table columns. To solve this, I chose to use Hibernate for persistence and use Ant/XDoclet to dynamically create my database tables. Rather than lose my tables’ data each time, I integrated DBUnit, which also came in handy when running unit tests. I decided to use Tomcat/MySQL as the default server/database setup because I was most familiar with them. I integrated a plethora of unit/integration tests so I could make sweeping changes and verify that everything still worked (including the JSPs) by running ant test-all.

自从它的第一个发布版本以来,AppFuse已经经历了许多改变和发展。大多数的技术选择是凭经验得出的。保持ValueObjects (VOs)ActionForms同步是一件很痛苦的事情,于是我使用了XDoclet来生成ActionsForms。我发现编写jsbc代码是非常枯燥乏味的,而当更新表字段的时候修改sqlVOs的代码是一件更枯燥的事情。为了解决这些问题,我选择使用Hibernate作为数据持久层并且使用了Ant/XDoclet来动态创建我的数据库的表。Rather than lose my tables’ data each time,我集成了DBUnit, which also came in handy when running unit tests.使用Tomcat/MySQL作为默认的服务器和数据库是因为我最熟悉它们。我集成了所有的测试这样我能够在做出了大量改变以后运行ant test-all可以检查一切是否仍然可以正常工作(包括JSP

In March of 2004, I moved the AppFuse project from the Struts project on SourceForge to java.net. I had a couple of reasons for doing this. First of all, it was a sub-project on SourceForge, and its user base was growing quickly. It needed dedicated mailing lists and forums. Secondly, java.net seemed to do a better job of marketing projects and I’d heard their CVS system was much more stable. My experience at java.net has been quite nice: it’s a very stable system, and the administrators are very supportive of the project and have even helped with marketing it.

20044月,我将AppFuse项目从 SourceForgeStruts project移到了java.net。我这样作有几个原因。首先是AppFuseSourceForge的一个子项目,它的用户基础增长的非常快,需要专门的邮件列表和论坛。第二是因为java.net看起来提供了更好的销售项目的工作而且我听说他们的CVS系统非常的稳定。我在java.net的经历非常的美好:他是一个非常稳定的系统。而且管理员对项目的维护和支持非常的有效。