![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php设计模式
淘气宝宝
这个作者很懒,什么都没留下…
展开
-
设计模式--责任链模式
以下是自学it网--中级班上课笔记 网址:www.zixue.it 责任链模式适合在举报的场景下用 举报页面 粗口 威胁 黄赌毒 分裂国家 以下是责任链模式 interface process{ function doing($type); }原创 2013-06-08 10:24:57 · 487 阅读 · 0 评论 -
设计模式--单例模式
以下是自学it网--中级班上课笔记 网址:www.zixue.it <?php //单例模式 class danli{ protected static $newdanli = null; protected $num; private function __construct() { $this->num = ra原创 2013-06-08 10:11:18 · 447 阅读 · 0 评论 -
设计模式--观察者模式
以下是自学it网--中级班上课笔记 网址:www.zixue.it /* 考虑如下场景: 1次密码错,提醒重登陆 2次错,出验证码 5次错,验证码变复杂 10次错,锁死账号 常规思路: 当判断用户名/密码不匹配后 { if(错) { 次数+1 } if(次数==1) { } else if(次数原创 2013-06-08 10:34:42 · 868 阅读 · 0 评论 -
设计模式--工厂模式
以下是自学it网--中级班上课笔记 网址:www.zixue.it <?php 工厂模式 interface db{ function connect(); } class gao_mysql implements db{ public function connect(){原创 2013-06-08 10:15:04 · 571 阅读 · 0 评论