rpodwika/designpatterns
Composer 安装命令:
composer require rpodwika/designpatterns
包简介
PHP Design Patterns
README 文档
README
#Design Patterns for PHP
##Why
For my own pratice and to help other programmers I decided to implement several Design Patterns in PHP. I hope you like it and you will find it helpful. If you have any suggestions how can I write something better please create pull request or message me
##What are design patterns
Design problems are proven to work solutions for problems that often occur while writing applications.
##Why to use them
Because they solve problems. You do not need to invent solution that is already working. How many times during your programmer career you had this feeling that you already solved problem that you are facing now? Same goes with patterns you have problem that could be solved using specific pattern. Keep in mind that you should not force your code to fit in patterns. It should come out naturally. Firstly K.I.S.S.
##Implemented patterns
- Antipatterns
- Singleton - One global instance of a class
- Behavioral
- Adapter - adapt class behavior to new conditions without modifying source of original class
- Chain of responsibility - Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request
- Memento - Without violating encapsulation, capture and externalize an object's internal state
- Observer - Define one to many dependency between objects so that when one changes state, all its dependents are notified and updated automatically
- Proxy - Do some operations before giving access to origin object
- State - allow object to alter its behavior depending on current internal state change.
- Strategy - Define a family of algorithms and make them interchangeable.
- Creational
- Abstract Factory - Provides interface for creating families of objects working together without specification of concrete classes
- Factory - Define an interface for creating an object but let the subclasses decide which class to instantiate
- Structural
- Decorator - Attach additional object features dynamically without subclassing or modifying source class.
##To be implemented
- Builder
- Prototype
- Bridge
- Composite
- Facade
- Flyweight
- Command
- Interpreter
- Iterator
- Mediator
- Visitor
rpodwika/designpatterns 适用场景与选型建议
rpodwika/designpatterns 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 9, 最近一次更新时间为 2015 年 07 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 rpodwika/designpatterns 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rpodwika/designpatterns 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 9
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL
- 更新时间: 2015-07-09