1 // $Header: /cvsroot/daoexamples/daoexamples/src/java/daoexamples/movie/MovieDAOFactory.java,v 1.6 2003/08/13 04:16:18 sullis Exp $
2
3 /*
4 *
5 *
6 *
7 *
8 */
9
10 package daoexamples.movie;
11
12 /***
13 * <p>
14 * Normally, a DAO factory class contains
15 * only one public "getFooDAO" method. This class provides
16 * two "get" methods because we want this factory to expose
17 * both of the {@link MovieDAO} implementations.
18 * </p>
19 *
20 * @author Sean C. Sullivan
21 *
22 */
23 public final class MovieDAOFactory
24 {
25 private MovieDAOFactory()
26 {
27 // this constructor is intentionally private
28 }
29
30 /***
31 *
32 *
33 * @return a non-null value. The DAO returned by this
34 * method uses JDBC transactions. The DAO
35 * demaractes transactions internally.
36 *
37 * @see #getMovieDAO_JTA()
38 *
39 *
40 */
41 public static MovieDAO getMovieDAO()
42 {
43 return new MovieDAOImpl();
44 }
45
46 /***
47 *
48 * @return a non-null value. The DAO returned by this
49 * method assumes that the caller is using JTA
50 * transactions. Transactions are demarcated external
51 * to the DAO.
52 *
53 * @see #getMovieDAO()
54 *
55 */
56 public static MovieDAO getMovieDAO_JTA()
57 {
58 return new MovieDAOImplJTA();
59 }
60
61 }
This page was automatically generated by Maven