15.1. Files, Packages and Object Model

The files of the Core JDO library are in these directories:

src                             Java sources
web                             JSP sources and Web content
conf                            Tomcat configuration
doc                             JavaDoc output
classes                         Compiler output

The project can be compiled by Ant (build.xml) and run either as a command-line application or as a Web application. The Core JDO Library Java sources are split into three packages, as indicated in Figure 15-1.

Figure 15-1. Core JDO library packages.


The usecase package contains the business logic, serves as a testbed and supports command-line invocation. Every use-case is coded in a single class and can be called either by a simple command-line interpreter or by external code. The pattern for this kind of implementation is called Command. An instance of the usecase classes has a single execute() method and runs a single JDO transaction for that method. The benefit of this approach is a single point in the code, where transactions are begun, committed, or rolled back. On the other hand, exception handling and error processing can become quite uncomfortable.

The model package contains all persistence-capable classes that define the class hierarchy shown in Figure 15-2: Persistent object model.

Figure 15-2. Persistent object model.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset