org.dartra.framework.dao
Interface DAOFactory


public interface DAOFactory

Factory interface for objects that can create data access objects (DAOs). This interface thus defines an abstract factory (GoF design pattern). These factories are also responsible for general initialisation and shutdown of the persistent store used by the DAOs that they create.

Note that the DAOs created by this kind of factory are not yet initialized. So you will have to call the init() method before you start using the DAO.

Author:
Erwin Vervaet

Method Summary
 void closeDataSource(DataSource dataSource)
          Try to close (shutdown) the given data source.
 BoardDAO createBoardDAO()
          Create a new board DAO.
 DartsSetDAO createDartsSetDAO()
          Create a new darts set DAO.
 GameDAO createGameDAO()
          Create a new game DAO.
 UserDAO createUserDAO()
          Create a new user DAO.
 void initDataSource(DataSource dataSource)
          Initialize given data source so that it can be used by the DAOs created by this factory.
 

Method Detail

initDataSource

public void initDataSource(DataSource dataSource)
                    throws DataAccessException

Initialize given data source so that it can be used by the DAOs created by this factory.

Implementations of this method are expected to be smart enough to detect whether or not the data source should be initialized. So multiple calls to this method should only result in a single initialisation.

Throws:
DataAccessException

closeDataSource

public void closeDataSource(DataSource dataSource)
                     throws DataAccessException

Try to close (shutdown) the given data source.

Throws:
DataAccessException

createBoardDAO

public BoardDAO createBoardDAO()

Create a new board DAO.


createDartsSetDAO

public DartsSetDAO createDartsSetDAO()

Create a new darts set DAO.


createGameDAO

public GameDAO createGameDAO()

Create a new game DAO.


createUserDAO

public UserDAO createUserDAO()

Create a new user DAO.