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.

graphics/15fig01.gif

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.

graphics/15fig02.gif



Core Java Data Objects
Core Java Data Objects
ISBN: 0131407317
EAN: 2147483647
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net