add the generic handler and the request classes

This commit is contained in:
Trismegiste
2013-05-12 20:52:29 +02:00
parent fc781c891a
commit 5ef810f3d0
3 changed files with 103 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
/*
* DesignPatternPHP
*/
namespace DesignPatterns\ChainOfResponsibilities;
/**
* Request is a request which goes throught the chain of responsibilities.
*
* About the request : Sometimes, you don't need an object, just an integer or
* an array. But in this case of a full example, I've made a class to illustrate
* this important idea in the CoR (Chain of Responsibilities). In real world,
* I recommand to always use a class, even a \stdClass if you want, it proves
* to be more adaptative because a single handler doesn't know much about the
* outside world and it is more difficult if, one day, you want add some
* criterion in a decision process.
*/
class Request
{
}