# design **Repository Path**: simengphp/design ## Basic Information - **Project Name**: design - **Description**: PHP的几种设计模式 - **Primary Language**: PHP - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-11-08 - **Last Updated**: 2020-12-20 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # design PHP的几种设计模式 测试文件: index.php 一、单例模式: instance.php introduce by simengphp : 特点:1)包含一个静态的变量 2)包含一个静态方法 3)禁止克隆的方法 单例的理解:将对象赋值给一个静态的变量,实例化一次通过静态变量调用永久复用 二、工厂模式: factory.php 注册树模式:register.php 适配器模式:match.php 策略模式: tactics.php 观察者模式:observe.php 原型模式: prototype.php 装饰模式: adorn.php 迭代器模式:iterator.php 代理模式: agency.php