| 1 |
joko |
1.1 |
<?php |
| 2 |
|
|
|
| 3 |
|
|
/** |
| 4 |
|
|
* This file contains the DesignPattern::Facade class. |
| 5 |
|
|
* |
| 6 |
|
|
* @author Andreas Motl <andreas.motl@ilo.de> |
| 7 |
joko |
1.4 |
* @package org.netfrag.glib |
| 8 |
joko |
1.2 |
* @name DesignPattern::Facade |
| 9 |
|
|
* |
| 10 |
joko |
1.7 |
*/ |
| 11 |
|
|
|
| 12 |
|
|
|
| 13 |
|
|
/** |
| 14 |
joko |
1.2 |
* <b>Cvs-Log:</b> |
| 15 |
|
|
* |
| 16 |
|
|
* <pre> |
| 17 |
joko |
1.8 |
* $Id: Facade.php,v 1.7 2003/03/10 23:30:27 joko Exp $ |
| 18 |
joko |
1.2 |
* |
| 19 |
|
|
* $Log: Facade.php,v $ |
| 20 |
joko |
1.8 |
* Revision 1.7 2003/03/10 23:30:27 joko |
| 21 |
|
|
* + fixed metadata for phpDocumentor |
| 22 |
|
|
* |
| 23 |
joko |
1.7 |
* Revision 1.6 2003/03/10 23:25:04 joko |
| 24 |
|
|
* + fixed metadata for phpDocumentor |
| 25 |
|
|
* |
| 26 |
joko |
1.6 |
* Revision 1.5 2003/03/10 22:31:56 joko |
| 27 |
|
|
* + fixed metadata for phpDocumentor |
| 28 |
|
|
* |
| 29 |
joko |
1.5 |
* Revision 1.4 2003/03/05 23:16:48 joko |
| 30 |
|
|
* updated docu - phpDocumentor is very strict about its 'blocks'... |
| 31 |
|
|
* |
| 32 |
joko |
1.4 |
* Revision 1.3 2003/03/05 17:28:43 joko |
| 33 |
|
|
* updated docu (phpDocumentor testing....) |
| 34 |
|
|
* |
| 35 |
joko |
1.3 |
* Revision 1.2 2003/03/05 17:02:22 joko |
| 36 |
|
|
* updated docu (phpDocumentor testing....) |
| 37 |
|
|
* |
| 38 |
joko |
1.2 |
* Revision 1.1 2003/03/03 21:56:01 joko |
| 39 |
|
|
* + initial commit |
| 40 |
|
|
* just a skeleton by now... |
| 41 |
|
|
* |
| 42 |
joko |
1.8 |
* </pre> |
| 43 |
joko |
1.1 |
* |
| 44 |
|
|
*/ |
| 45 |
|
|
|
| 46 |
joko |
1.2 |
|
| 47 |
joko |
1.1 |
/** |
| 48 |
joko |
1.2 |
* Load required modules: |
| 49 |
joko |
1.1 |
* |
| 50 |
|
|
*/ |
| 51 |
joko |
1.2 |
loadModule('Class::Logger'); |
| 52 |
joko |
1.1 |
|
| 53 |
|
|
|
| 54 |
|
|
/** |
| 55 |
|
|
* --- An attempt to implement some software design patterns... |
| 56 |
|
|
* --- FacadePattern |
| 57 |
|
|
* |
| 58 |
|
|
* --- http://c2.com/cgi-bin/wiki?FacadePattern |
| 59 |
|
|
* Intent: Provide a unified interface to a set of interfaces in a subsystem. |
| 60 |
|
|
* Facade defines a higher-level interface that makes the subsystem easier to use. |
| 61 |
|
|
* This can be used to simplify a number of complicated object interactions into a single interface. |
| 62 |
|
|
* |
| 63 |
|
|
* @author Andreas Motl <andreas.motl@ilo.de> |
| 64 |
|
|
* @copyright (c) 2003 - All Rights reserved. |
| 65 |
joko |
1.2 |
* @link http://www.netfrag.org/~joko/ |
| 66 |
|
|
* |
| 67 |
joko |
1.1 |
* @license GNU LGPL (GNU Lesser General Public License) |
| 68 |
joko |
1.2 |
* @link http://www.gnu.org/licenses/lgpl.txt |
| 69 |
joko |
1.1 |
* |
| 70 |
|
|
* @package org.netfrag.glib |
| 71 |
joko |
1.3 |
* @subpackage DesignPattern |
| 72 |
joko |
1.2 |
* @name DesignPattern::Facade |
| 73 |
joko |
1.1 |
* |
| 74 |
joko |
1.6 |
* @todo this: |
| 75 |
|
|
* - xyz |
| 76 |
|
|
* - bla, bli, blub |
| 77 |
joko |
1.1 |
* |
| 78 |
|
|
*/ |
| 79 |
|
|
class DesignPattern_Facade extends Class_Logger { |
| 80 |
|
|
|
| 81 |
|
|
var $_about; |
| 82 |
|
|
var $_container; |
| 83 |
|
|
|
| 84 |
|
|
function constructor() { |
| 85 |
|
|
parent::constructor(); |
| 86 |
|
|
//loadModule('Data::Container'); |
| 87 |
|
|
$this->_container = php::mkComponent('Data::Container'); |
| 88 |
|
|
} |
| 89 |
|
|
|
| 90 |
|
|
function perform() { |
| 91 |
|
|
$this->_abstract_method('perform', 'DesignPattern::Facade'); |
| 92 |
|
|
} |
| 93 |
|
|
|
| 94 |
|
|
function about() { |
| 95 |
|
|
$this->_about = |
| 96 |
|
|
<<<ABOUT |
| 97 |
|
|
* --- DesignPattern::Facade |
| 98 |
|
|
* --- http://cvs.netfrag.org/nfo/php/libs/org.netfrag.glib/DesignPattern/Facade.php |
| 99 |
|
|
* |
| 100 |
|
|
* http://c2.com/cgi-bin/wiki?FacadePattern says... |
| 101 |
|
|
* Intent: Provide a unified interface to a set of interfaces in a subsystem. |
| 102 |
|
|
* Facade defines a higher-level interface that makes the subsystem easier to use. |
| 103 |
|
|
* This can be used to simplify a number of complicated object interactions into a single interface. |
| 104 |
|
|
* http://www.fluffycat.com/java/patterns.html says... |
| 105 |
|
|
* One class has a method that performs a complex process calling several other classes. |
| 106 |
|
|
ABOUT; |
| 107 |
|
|
} |
| 108 |
|
|
|
| 109 |
|
|
} |
| 110 |
|
|
|
| 111 |
|
|
?> |