1、华北科技学院毕业设计 (论文 ) - 1 - 外文科技资料翻译 英文原文 AppFuse: J2EE web application by Matt Raible 07/15/2004 1 Start your AppFuse J2EE web application One of the hardest parts about J2EE development is getting started. There is an immense amount of open source tools for web app development. Making a decision on whi
2、ch technologies to use can be tough - actually beginning to use them can be even more difficult. Once youve decided to use Struts and Hibernate, how do you go about implementing them? If you look on the Hibernate site or the Struts site, youll probably have a hard time finding any information on int
3、egrating the two. What if you want to throw Spring into the mix? As a developer, the best way for me to learn is by viewing sample apps and tutorials that explain how to extend those applications. In order for me to learn (and remember) how to integrate open source technologies such as Hibernate, Sp
4、ring, Struts, and Ant/XDoclet, I created AppFuse. The beauty of AppFuse is you can actually get started with Hibernate, Spring, and Struts without even knowing much about them. Using test-driven development, AppFuse and its tutorials will show you how to develop a J2EE web application quickly and ef
5、ficiently. 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 Id done a lot of front-end work (Struts, HTML, etc.) over the years, t
6、he 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 contra
7、ct, 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
8、, published by Apress. When you write a technical book, its 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 华北科技学院毕业设计 (论文 ) - 2 - something meaningful; something I could use after I was done writing. My initia
9、l 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 d
10、eveloping 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-specif
11、ic 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. Since its initial release, AppFuse has gone through many changes and improvements. Most of the te
12、chnology 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 Hiberna
13、te 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.
14、 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 . In March of 2004, I moved the AppFuse project from the Struts project on SourceForge to . I had a couple of reasons for doing thi
15、s. 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, seemed to do a better job of marketing projects and Id heard their CVS system was much more stable. My experience at has been quite nice: its a very
16、stable system, and the administrators are very supportive of the project and have even helped with marketing it. 3 What is AppFuse? So after all that history, what is AppFuse? At its very core, AppFuse is a web application that you can package into a .war and deploy to a J2EE 1.3-compliant app server. Its designed to help you create new web applications using a new target in its build.xml file. The new target