package versao2.persistencia.impl;

import versao2.persistencia.ClienteDAO;
import versao2.persistencia.DAOFactory;
import versao2.persistencia.PedidoDAO;

/**
 * Implementacao da fabrica de objetos de acesso a dados
 *
 * @see versao2.persistencia.DAOFactory
 */
public final class DAOFactoryImpl extends DAOFactory {
  /**
   * Singleton
   *
   * @label singleton
   */
  private static DAOFactoryImpl instance;

  // Inicializacao do Singleton
  static{
    instance = new DAOFactoryImpl();
  }

  /**
   * Obtem uma fabrica de DAOs
   *
   * @return DAOFactoryImpl
   */
  public static DAOFactoryImpl getInstance(){
    return instance;
  }

  public ClienteDAO createClienteDAO() {
    return ClienteDAOImpl.getInstance();
  }

  public PedidoDAO createPedidoDAO(){
    return PedidoDAOImpl.getInstance();
  }


}
