设计模式的PHP实现示例(转)
symfony2 很多设计模式思想,下面的资料会有点帮助:http://www.open-open.com/lib/view/open1414996676559.html
阅读目录
这是一些用PHP实现著名设计模式的示例代码。每个模式都有例子(其中大部分来自Zend框架,Symfony2或Doctrine2)。
Patterns
The patterns can be structured in roughly three different categories. Please click on the
for a full explanation of the pattern on Wikipedia.
Creational
- AbstractFactory
![:notebook: :notebook:]()
- Builder
![:notebook: :notebook:]()
- FactoryMethod
![:notebook: :notebook:]()
- Multiton (is considered an anti-pattern!
) - Pool
![:notebook: :notebook:]()
- Prototype
![:notebook: :notebook:]()
- SimpleFactory
- Singleton
(is considered an anti-pattern!
) - StaticFactory
Structural
- Adapter
![:notebook: :notebook:]()
- Bridge
![:notebook: :notebook:]()
- Composite
![:notebook: :notebook:]()
- DataMapper
![:notebook: :notebook:]()
- Decorator
![:notebook: :notebook:]()
- DependencyInjection
![:notebook: :notebook:]()
- Facade
![:notebook: :notebook:]()
- FluentInterface
![:notebook: :notebook:]()
- Proxy
![:notebook: :notebook:]()
- Registry
![:notebook: :notebook:]()
Behavioral
- ChainOfResponsibilities
![:notebook: :notebook:]()
- Command
![:notebook: :notebook:]()
- Iterator
![:notebook: :notebook:]()
- Mediator
![:notebook: :notebook:]()
- Memento
![:notebook: :notebook:]()
- NullObject
![:notebook: :notebook:]()
- Observer
![:notebook: :notebook:]()
- Specification
![:notebook: :notebook:]()
- State
![:notebook: :notebook:]()
- Strategy
![:notebook: :notebook:]()
- TemplateMethod
![:notebook: :notebook:]()
- Visitor
![:notebook: :notebook:]()
More
浙公网安备 33010602011771号