From 2403083d614ff077757f2ae19aa93297c0b5e493 Mon Sep 17 00:00:00 2001 From: Dominik Liebler Date: Tue, 24 Sep 2013 13:18:21 +0200 Subject: [PATCH] README Decorator --- Decorator/Decorator.php | 17 ++++------------- Decorator/README.md | 10 ++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 Decorator/README.md 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)