DesignPatternsPHP
This is a collection of known design patterns and some sample code how to implement them in PHP. Every pattern has a small list of examples.
I think the problem with patterns is that often people do know them but don’t know when to apply which.
Patterns
The patterns can be structured in roughly three different categories. Please click on the title of every pattern’s page for a full explanation of the pattern on Wikipedia.
- 1. Criacional
- 2. Estrutural
- 2.1. Adaptador (Adapter / Wrapper)
- 2.2. Ponte (Bridge)
- 2.3. Composto (Composite)
- 2.4. Mapeador de dados (Data Mapper)
- 2.5. Decorador (Decorator)
- 2.6. Injeção de dependência (Dependency Injection)
- 2.7. Facade (Fachada)
- 2.8. Interface Fluente (Fluent Interface)
- 2.9. Flyweight (Mosca)
- 2.10. Proxy
- 2.11. Registry (Registro)
- 3. Comportamental
- 3.1. Cadeia de Responsabilidades (Chain Of Responsibilities)
- 3.2. Comando (Command)
- 3.3. Interpretador (Interpreter)
- 3.4. Iterator (Iterador)
- 3.5. Mediator (Mediador)
- 3.6. Memento (Lembrança)
- 3.7. Objeto Nulo (Null Object)
- 3.8. Observador (Observer)
- 3.9. Especificação
- 3.10. Estado
- 3.11. Estratégia
- 3.12. Método Modelo (Template Method)
- 3.13. Visitante (Visitor)
- 4. Outros