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. Kreacyjne (Creational)
- 2. Strukturalne (Structural)
- 2.1. Adapter (Adapter / Wrapper)
- 2.2. Most (Bridge)
- 2.3. Kompozyt (Composite)
- 2.4. Konwerter danych (Data Mapper)
- 2.5. Dekorator (Decorator)
- 2.6. Wstrzykiwanie zależności (Dependency Injection)
- 2.7. Fasada (Facade)
- 2.8. Płynny interfejs (Fluent Interface)
- 2.9. Pyłek (Flyweight)
- 2.10. Pełnomocnik (Proxy)
- 2.11. Rejestr (Registry)
- 3. Czynnościowe/Operacyjne (Behavioral)
- 3.1. Łańcuch zobowiązań (Chain Of Responsibilities)
- 3.2. Polecenie (Command)
- 3.3. Interpreter
- 3.4. Iterator (Iterator)
- 3.5. Mediator (Mediator)
- 3.6. Pamiątka (Memento)
- 3.7. Pusty obiekt (Null Object)
- 3.8. Obserwator (Observer)
- 3.9. Specyfikacja (Specification)
- 3.10. Stan (State)
- 3.11. Strategia (Strategy)
- 3.12. Metoda szablonowa (Template Method)
- 3.13. Odwiedzający (Visitor)
- 4. Pozostałe