Application Architecture
The application in this chapter is a classic three-tier applicationa browser accesses an application server, which in turn accesses a database. Figure 2.1 shows the files used by the application. Note that the application works with persistent objects, not directly with the database. Handcrafted Hibernate mapping files generate the persistent objects and the database definition. The mapping files provide development-time information and also runtime configuration information.

The JSP pages in the application are typical, insofar as each page contains a small amount of persistent logic corresponding to its action. In a larger-scale application, it would be best to move the logic in the JSP pages into Java classes, but for an application of this size the present approach works reasonably well.
The handcrafted portions of the application are the JSP pages, the single Java class, and the two mapping files (*.hbm.xml). The heart of the application is described by two mapping files. As a reminder, you are strongly encouraged to start by downloading the source for this example from http://www.cascadetg.com/hibernate/ and then use it to follow along.
 |