⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 moviedaofactory.java

📁 java编程中的DAO模式举例,其他人不需帐号就可自由下载此源码
💻 JAVA
字号:
// $Header: /cvsroot/daoexamples/daoexamples/src/java/daoexamples/movie/MovieDAOFactory.java,v 1.6 2003/08/13 04:16:18 sullis Exp $
 
/*
 * 
 *
 * 
 * 
 */
 
package daoexamples.movie;

/**
 * <p>
 * Normally, a DAO factory class contains 
 * only one public "getFooDAO" method. This class provides 
 * two "get" methods because we want this factory to expose 
 * both of the {@link MovieDAO} implementations. 
 * </p>
 * 
 * @author Sean C. Sullivan
 *
 */
public final class MovieDAOFactory
{
	private MovieDAOFactory()
	{
		// this constructor is intentionally private
	}

	/**
	 * 
	 * 
	 * @return a non-null value. The DAO returned by this
	 *            method uses JDBC transactions. The DAO 
	 *            demaractes transactions internally.
	 *  
	 * @see #getMovieDAO_JTA()
	 * 
	 * 
	 */
	public static MovieDAO getMovieDAO()
	{
		return new MovieDAOImpl();
	}

	/**
	 * 
	 * @return a non-null value. The DAO returned by this
	 *         method assumes that the caller is using JTA 
	 *         transactions. Transactions are demarcated external 
	 *         to the DAO.
	 *  
	 * @see #getMovieDAO()
	 * 
	 */
	public static MovieDAO getMovieDAO_JTA()
	{
		return new MovieDAOImplJTA();
	}
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -