KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > manentia > kasai > user > UserDAOFactory


1 /*
2  * UserDAOFactory.java
3  *
4  * Created on 28 de marzo de 2005, 13:53
5  */

6
7 package org.manentia.kasai.user;
8
9 /**
10  *
11  * @author rzuasti
12  */

13 public class UserDAOFactory {
14     
15     private static UserDAOFactory instance;
16     
17     private UserDAO dao;
18     
19     /** Creates a new instance of UserDAOFactory */
20     private UserDAOFactory() {
21         dao = new JDBCMySQLUserDAO();
22     }
23  
24     public static synchronized UserDAOFactory getInstance(){
25         if (instance == null){
26             instance = new UserDAOFactory();
27         }
28         
29         return instance;
30     }
31     
32     public UserDAO createDAO(){
33         return dao;
34     }
35 }
36
Popular Tags