diff --git a/Decorator/Decorator.php b/Decorator/Decorator.php index 88c1b84..0d314c2 100644 --- a/Decorator/Decorator.php +++ b/Decorator/Decorator.php @@ -2,24 +2,15 @@ namespace DesignPatterns\Decorator; -/** - * Decorator pattern - * - * Purpose: - * to dynamically add new functionality to class instances - * - * Examples: - * - Zend Framework: decorators for Zend_Form_Element instances - * - Web Service Layer: Decorators JSON and XML for a REST service (in this case, only one of these should be allowed of - * course) - * - */ - /** * the Deoorator MUST implement the RendererInterface contract, this is the key-feature * of this design pattern. If not, this is no longer a Decorator but just a dumb * wrapper. */ + +/** + * class Decorator + */ abstract class Decorator implements RendererInterface { /** diff --git a/Decorator/README.md b/Decorator/README.md new file mode 100644 index 0000000..528a0f2 --- /dev/null +++ b/Decorator/README.md @@ -0,0 +1,10 @@ +# Decorator + +## Purpose + +To dynamically add new functionality to class instances. + +## Examples + +* Zend Framework: decorators for Zend_Form_Element instances +* Web Service Layer: Decorators JSON and XML for a REST service (in this case, only one of these should be allowed of course)