Unleash Your Potential - Namagunga Girls Coding Club
PHP Design Patterns Guide
1.
2. Design Patterns Un design pattern o patrón de diseño es una solución reutilizable frente a problemas frecuentes en el diseño de software.
3.
4. Factory method El factory pattern es una clase que tiene una sierie de methods que permiten crear objetos.
5.
6.
7.
8.
9.
10. Command Un objeto es utilizado para representar y encapsular todo la información necesaria para llamar luego a un method. Esta información incluye el method name, el objeto dueño del method y los valores los parámetros del method.
11.
12.
13. Cadena de responsabilidades Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle a request. Chain the receiving objects and pass the request along the chain until an object handles it. A mechanism also exists for adding new processing objects to the end of this chain. Variación: árbol de responsabilidad..
14.
15.
16. Decorator Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality The original code is open to extension but closed to modification “ Open/closed principle”
17.
18. Composite The composite pattern describes that a group of objects are to be treated in the same way as a single instance of an object. Compose objects into tree structures to represent part-whole hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly.
19.
20. State Allow an object to alter its behavior when its internal state changes. The object will appear to change its class.