15.3. Use-case Package

This package contains the implementation of the application use-cases. It uses an abstract base class based on the command pattern that implements common methods for all transactions and defines an abstract execute method. Each use-case class extends this abstract class and implements the execute method.

15.3.1. AbstractUserCase class

The base class for the use-cases implements the basic methods to get the PersistenceManagerFactory and PersistenceManager instances, begin and commit transactions, and handle exceptions.

15.3.1.1. PerstistenceManagerFactory bootstrapping

As shown in earlier chapters, PersistenceManagerFactory bootstrapping can be done using a singleton pattern and reading properties from a file to avoid hard ...

Get Core Java™ Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.