Sommaire
Introduction
Liste des patterns
| Pattern | Type | Difficulté (/10) | Présence dans Laravel |
|---|---|---|---|
| Singleton | Créationnel | 2 | Facades, Service Providers |
| Factory Method | Créationnel | 4 | Factories (Testing, Database) |
| Factory | Créationnel | 3 | Service Providers |
| Data Transfer Object | Structurel | 4 | Non |
| Value Object | Créationnel | 3 | Non |
| Dependency Injection | Créationnel | 6 | Service Container |
| Builder | Créationnel | 5 | Query Builder |
| ORM | Architectural | 7 | Eloquent ORM |
| Observer | Comportemental | 5 | Eloquent Observers |
| Command | Comportemental | 5 | Artisan Commands |
| Chain Of Responsibility | Comportemental | 6 | Middlewares |
| Template Method | Comportemental | 4 | Blade Templates |
| Iterator | Comportemental | 4 | Collections |
| Pipeline | Comportemental | 7 | Pipeline |
| Facade | Structurel | 4 | Facades |
| Registry | Structurel | 4 | Non |
| Proxy | Structurel | 6 | Facades |
| Adapter | Structurel | 5 | Adapters for Mail, Cache, etc. |
| Mixin (Macroable) | Structurel | 5 | Macroable Trait |
| Repository | Structurel | 6 | Non |
| Service | Architectural | 5 | Service Container |
| Command Bus | Architectural | 7 | Bus (Queue, Events, Commands) |
| Decorator | Structurel | 6 | Non |
| Null Object | Comportemental | 3 | Non |
| Strategy | Comportemental | 5 | Non |
| Mediator | Comportemental | 7 | Non |
| Memento | Comportemental | 6 | Non |
| Visitor | Comportemental | 8 | Non |
| Specification | Comportemental | 7 | Non |
| State | Comportemental | 6 | Non |
| Interpreter | Comportemental | 8 | Non |
| Composite | Structurel | 6 | Non |
| Bridge | Structurel | 7 | Non |
| Flyweight | Structurel | 8 | Non |
| Hexagonal Architecture | Architectural | 9 | Non |
| Saga | Architectural | 8 | Non |
Comparatifs
| Patterns à Comparer | Détail |
|---|---|
| State, Memento | Gestion des états d'un objet et historique |
| Chain of Responsibility, Pipeline | Enchaînement de traitements dynamiques |
| Proxy, Mixin | Ajout dynamique de comportements |
| Strategy, Facade, Decorator | Changement et extension de comportements |
| Bridge, Strategy | Séparation et délégation des responsabilités |
| Repository, Data Transfer Object, Value Object, Factory | Gestion des données simples et immuables |
| Proxy, Decorator, Visitor, Hexagonal | Extension dynamique, accès contrôlé, et architecture complexe |
| Adapter, Data Transfer Object | Transformation et transport de données |
| Composite, Template | Structure d'objets imbriqués et réutilisation des comportements |
| Factory Method, Facade, Registry | Création d'objets et simplification des interfaces |
| Specification, Interpreter | Vérification de règles et interprétation de logique complexe |
| Saga, Mediator | Gestion de transactions complexes et centralisation de la communication |
| Template, Factory Method, Strategy | Structures fixes avec des étapes personnalisables |
| Iterator, Composite | Gestion et parcours d'objets imbriqués ou collections |
| Builder, Data Transfer Object | Construction progressive d'objets complexes |