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 |
|
|
* @module DesignPattern::Facade |
8 |
|
|
* |
9 |
|
|
*/ |
10 |
|
|
|
11 |
|
|
/** |
12 |
|
|
* $Id: MVC.php,v 1.4 2003/03/01 22:44:54 joko Exp $ |
13 |
|
|
* |
14 |
|
|
* $Log: MVC.php,v $ |
15 |
|
|
* |
16 |
|
|
*/ |
17 |
|
|
|
18 |
|
|
|
19 |
|
|
/** |
20 |
|
|
* --- An attempt to implement some software design patterns... |
21 |
|
|
* --- FacadePattern |
22 |
|
|
* |
23 |
|
|
* --- http://c2.com/cgi-bin/wiki?FacadePattern |
24 |
|
|
* Intent: Provide a unified interface to a set of interfaces in a subsystem. |
25 |
|
|
* Facade defines a higher-level interface that makes the subsystem easier to use. |
26 |
|
|
* This can be used to simplify a number of complicated object interactions into a single interface. |
27 |
|
|
* |
28 |
|
|
* @author Andreas Motl <andreas.motl@ilo.de> |
29 |
|
|
* @copyright (c) 2003 - All Rights reserved. |
30 |
|
|
* @license GNU LGPL (GNU Lesser General Public License) |
31 |
|
|
* |
32 |
|
|
* @author-url http://www.netfrag.org/~joko/ |
33 |
|
|
* @license-url http://www.gnu.org/licenses/lgpl.txt |
34 |
|
|
* |
35 |
|
|
* @package org.netfrag.glib |
36 |
|
|
* @module DesignPattern::Facade |
37 |
|
|
* |
38 |
|
|
*/ |
39 |
|
|
|
40 |
|
|
/** |
41 |
|
|
* Todo: |
42 |
|
|
* |
43 |
|
|
* o xyz |
44 |
|
|
* o bla, bli, blub |
45 |
|
|
* |
46 |
|
|
* |
47 |
|
|
*/ |
48 |
|
|
|
49 |
|
|
/** |
50 |
|
|
* Load required modules: |
51 |
|
|
* |
52 |
|
|
*/ |
53 |
|
|
loadModule('Class::Logger'); |
54 |
|
|
|
55 |
|
|
class DesignPattern_Facade extends Class_Logger { |
56 |
|
|
|
57 |
|
|
var $_about; |
58 |
|
|
var $_container; |
59 |
|
|
|
60 |
|
|
function constructor() { |
61 |
|
|
parent::constructor(); |
62 |
|
|
//loadModule('Data::Container'); |
63 |
|
|
$this->_container = php::mkComponent('Data::Container'); |
64 |
|
|
} |
65 |
|
|
|
66 |
|
|
function perform() { |
67 |
|
|
$this->_abstract_method('perform', 'DesignPattern::Facade'); |
68 |
|
|
} |
69 |
|
|
|
70 |
|
|
function about() { |
71 |
|
|
$this->_about = |
72 |
|
|
<<<ABOUT |
73 |
|
|
* --- DesignPattern::Facade |
74 |
|
|
* --- http://cvs.netfrag.org/nfo/php/libs/org.netfrag.glib/DesignPattern/Facade.php |
75 |
|
|
* |
76 |
|
|
* http://c2.com/cgi-bin/wiki?FacadePattern says... |
77 |
|
|
* Intent: Provide a unified interface to a set of interfaces in a subsystem. |
78 |
|
|
* Facade defines a higher-level interface that makes the subsystem easier to use. |
79 |
|
|
* This can be used to simplify a number of complicated object interactions into a single interface. |
80 |
|
|
* http://www.fluffycat.com/java/patterns.html says... |
81 |
|
|
* One class has a method that performs a complex process calling several other classes. |
82 |
|
|
ABOUT; |
83 |
|
|
} |
84 |
|
|
|
85 |
|
|
} |
86 |
|
|
|
87 |
|
|
?> |