工厂模式 jdbc 面向接口dao 开发 单例
package com.itheima.utils; import java.io.IOException;
import java.io.InputStream;
import java.util.Properties; import com.itheima.dao.UserDao; /**
* 引入工厂,用于生成一些对象,为了生成的BeanFactory对象时,
* 不会生成多个对象(因为BeanFactory作为一个工厂,只要有一个它的对象就可以 了),可以引入单例模式
*
* 2.业务层要调用 Dao的什么 样的实现类,可以放入到配置文件
* 3.读取配置文件
* @author wangli
*
*/
public class BeanFactory { private BeanFactory(){}//私有构造 private static BeanFactory instance = new BeanFactory(); //再提供一个公有的方法
public static BeanFactory getInstance(){
return instance;
} private static String DAO;//用于存储从bean.properties文件 中读取的值
static{
try {
InputStream is = BeanFactory.class.getClassLoader().getResourceAsStream("bean.properties");
Properties p = new Properties();
p.load(is);
DAO = p.getProperty("dao");
} catch (Exception e) {
e.printStackTrace();
}
} public UserDao getUserDaoInstance(){
try {
Class clz = Class.forName(DAO);
return (UserDao)clz.newInstance();//通过反射生成对象 UserDaoMySqlImpl的对象 UserDaoDom4jImpl的对象
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
} }
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgcAAACCCAIAAABdIfwuAAAgAElEQVR4nO2deXRTd5bn35wzf8yZqek53Wc6VfSZPulM9cypSi/T0BQVTy1Jp0MNSYUQIAGSQJlgsEPIAgmUCA6U2YwJKQzE7CFmx7Zsy6tsyYtky5KsxZK17/tuybKs1YtszR8PJFl6epYNMgbu59xK6T397n33d3/S76vf70kGiQEAAADAA5DHnQAAAACwiECmp2NgYGBgYGCoIZPRKTAwMLBFaE3NLZ99/vmmOfLZ5583Nbc8qgiL03LaL2R8YupZtpMnT01Gpx97GovQFmdlFmdWi8GevsqQSE2FhUXnvqu4cePWnOzcdxWbN28hkZoePsLiHJ1c9wuhJ0Gj0YbcnshYdK6m1uiJROKVK1cuXbp06dKlK1euXLly5fLly0QiUa3R4ziGIpP+4FhJyeHRwBiPL1y7dm1hYeG33/7ZbLF3dt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9V8IkaYf8IAABg4UE8OWPeqgCSAAAA8LhYdKoAkgAAAPAYQdwPAYJF/Nl5qYKp5/oj+JupAAAAwPxAdA9HiiQkPxUOh+FXbAAAAE8WiOahiUtCynlQBQAAgCcORP0oQBCMOKAKAAAATxyPRhUwAVUAAAB44kCUOSMUCoEqAAAAPFkg8pwBqgAAAPDEgUhzRjAYBFUAAAB4sgBVAAAAABIg4pwBqgAAAPDEgYhyRiAQAFUAAAB4skCEucHj8ZjNZvh3mwEAAJ4skEBusFqt5eXlZWVloAoAAABPEMju3LBv377S0lJfEqAKAAAAi58c/gudKYAqAAAALH5AFQAAAIAEyJETZ3JqoAoAAABPEEhOo4MqAAAAPFmAKgAAAAAJQBUAAACABKAKAAAAQAJQBQAAACABqAIAAACQAFQBAAAASACqAAAAACQAVQAAAAASgCoAAAAACUAVAAAAgASgCgAAAEACUAUAAAAgAagCAAAAkABUAQAAAEgAqgAAAAAkAFUAAAAAEoAqAAAAAAlAFQAAAIAEoAoAAABAAlAFAAAAIAGoAgAAAJAAVAEAAABIAKoAAAAAJABVAAAAABKAKgAAAAAJQBUAAACABKAKAAAAQAJQBQAAACABqAIAAACQAFQBAAAASACqAAAAACQAVQAAAAASgCoAAAAACUAVAAAAgASgCgAAAEACUAUAAAAgAagCAAAAkABUAQAAAEgAqgAAAAAkAFUAAAAAEoAqAAAAAAlAFQAAAIAEoAoAAABAAlAFAAAAIAGoAgAAAJDg/wNx/qxpJo1khwAAAABJRU5ErkJggg==" alt="" />
工厂模式 jdbc 面向接口dao 开发 单例的更多相关文章
- 0606-工厂模式、单例模式、DBDA的单例和完整功能
工厂模式:只要指定类名,就可以据此获取一个该类的对象. 单例模式:某个类,只允许其“创建”出一个对象. 单例的方法:三私一公(一个私有化对象,一个私有化构造方法,一个私有化克隆方法,一个公共方法返回对 ...
- C# 工厂模式+虚方法(接口、抽象方法)实现多态
面向对象语言的三大特征之一就是多态,听起来多态比较抽象,简而言之就是同一行为针对不同对象得到不同的结果,同一对象,在不同的环境下得到不同的状态. 实例说明: 业务需求:实现一个打开文件的控制台程序的d ...
- apply 伴生对象 单例对象
apply(): 当类或者对象有一个主要用途时,apply方法提供了很好语法机制 scala> class Foo {} defined class Foo scala> object F ...
- iOS开发-工厂模式
工厂模式算是开发中比较常见的设计模式,简单工厂模式,工厂模式和抽象工厂模式,都属于工厂模式.简单工厂模式(simple factory)是类的创建模式,静态工厂方法(static factory me ...
- 利用工厂模式实现serviec层和dao层解耦
利用工厂模式实现serveice和dao层的解耦,这样就可以不用在service层实例化dao层的对象,当dao层代码发生改变的时候(数据库实现发生改变)直接修改配置文件就不用改变service层的代 ...
- 结合实例分析简单工厂模式&工厂方法模式&抽象工厂模式的区别
之前写过一篇关于工厂模式(Factory Pattern)的随笔,里面分析了简单工厂模式,但对于工厂方法和抽象工厂的分析较为简略.这里重新分析分析三者的区别,工厂模式是java设计模式中比较简单的一个 ...
- 抽象工厂模式[wiki]
抽象工厂[编辑] 维基百科,自由的百科全书 跳转至: 导航. 搜索 以统一塑模语言中的类型图来表示抽象工厂 抽象工厂模式(英语:Abstract factory pattern)是一种 ...
- c#工厂模式与抽象工厂模式
一. 工厂方法(Factory Method)模式 工厂方法(FactoryMethod)模式是类的创建模式,其用意是定义一个创建产品对象的工厂接口,将实际创建工作推迟到子类中. 工厂方法模式是简单工 ...
- 简单工厂模式&工厂方法模式&抽象工厂模式的区别
之前写过一篇关于工厂模式(Factory Pattern)的随笔,里面分析了简单工厂模式,但对于工厂方法和抽象工厂的分析较为简略.这里重新分析分析三者的区别,工厂模式是java设计模式中比较简单的一个 ...
随机推荐
- Debain install Jupyter
1. install Anaconda https://www.anaconda.com/download/#linux 2. config jupyter $ ipython from notebo ...
- springMVC绑定json参数之一
一.SpringMVC @RequestBody接收Json对象字符串 以前,一直以为在SpringMVC环境中,@RequestBody接收的是一个Json对象,一直在调试代码都没有成功,后来发现, ...
- AjaxMethod的使用
AjaxMethod的使用 使用AjaxMethod要满足一下几点: 1.如果还没有ajax.dll文件,就先下载一个来 2.将ajax.dll添加到项目引用中:在VS的解决方案资源管理器中右 ...
- JavaScript高级程序设计学习笔记第十五章--使用Canvas绘图
一.基本用法 1.要使用<canvas>元素,必须先设置其 width 和 height 属性,指定可以绘图的区域大小.能通过 CSS 为该元素添加样式,如果不添加任何样式或者不绘制任何图 ...
- [HDU1109]模拟退火算法
模拟退火的基本思想: (1) 初始化:初始温度T(充分大),初始解状态S(是算法迭代的起点),每个T值的迭代次数L (2) 对k=1,……,L做第(3)至第6步: (3) 产生新解$S\prime $ ...
- [HDU1754]I Hate It线段树裸题
http://acm.hdu.edu.cn/showproblem.php?pid=1754 解题关键:刚开始死活超时,最后发现竟然是ch,和t1.t2每次循环都定义的锅,以后养成建全局变量的习惯. ...
- SpringBoot05 数据操作03 -> JPA查询方法的规则定义
请参见<springboot详解>springjpa部分知识 1 按照方法命名来进行查询 待更新... package cn.xiangxu.springboot.repository; ...
- 项目一:第一天 1、项目概述 2、环境搭建(重点) 3、Jquery Easyui 前端UI框架 4、Jquery Ztree 树形插件使用
1.项目环境 注:添加jar包直接在common_parent里面添加. 搭建数据库 create tablespace bos317space datafile 'c:\ bos317.dbf' ...
- Ajax 执行流程 有用 一点
l 1.1使用JavaScript获得浏览器内置的AJAX引擎(XMLHttpRequest对象) l 1.2 通过AJAX引擎确定请求路径和请求参数 l 1.3 通知AJAX引擎发送请求 l AJA ...
- Hadoop Reducer个数设置
在默认情况下,一个MapReduce Job如果不设置Reducer的个数,那么Reducer的个数为1.具体,可以通过JobConf.setNumReduceTasks(int numOfReduc ...