README Decorator

This commit is contained in:
Dominik Liebler
2013-09-24 13:18:21 +02:00
parent 5efa752611
commit 2403083d61
2 changed files with 14 additions and 13 deletions

View File

@@ -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
{
/**

10
Decorator/README.md Normal file
View File

@@ -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)