5 |
* @author Andreas Motl <andreas.motl@ilo.de> |
* @author Andreas Motl <andreas.motl@ilo.de> |
6 |
* @package org.netfrag.glib |
* @package org.netfrag.glib |
7 |
* @name DesignPattern::RemoteProxy |
* @name DesignPattern::RemoteProxy |
|
* @filesource |
|
8 |
* |
* |
9 |
* |
* |
10 |
* <b>Cvs-Log:</b> |
* <b>Cvs-Log:</b> |
14 |
* $Id$ |
* $Id$ |
15 |
* ------------------------------------------------------------------------- |
* ------------------------------------------------------------------------- |
16 |
* $Log$ |
* $Log$ |
17 |
|
* Revision 1.8 2003/03/10 22:31:56 joko |
18 |
|
* + fixed metadata for phpDocumentor |
19 |
|
* |
20 |
|
* Revision 1.7 2003/03/09 15:51:44 joko |
21 |
|
* + additional metadata for Autodia |
22 |
|
* |
23 |
|
* Revision 1.6 2003/03/05 17:28:43 joko |
24 |
|
* updated docu (phpDocumentor testing....) |
25 |
|
* |
26 |
|
* Revision 1.5 2003/03/05 17:02:22 joko |
27 |
|
* updated docu (phpDocumentor testing....) |
28 |
|
* |
29 |
* Revision 1.4 2003/03/05 16:32:19 joko |
* Revision 1.4 2003/03/05 16:32:19 joko |
30 |
* updated docu (phpDocumentor testing....) |
* updated docu (phpDocumentor testing....) |
31 |
* |
* |
138 |
|
|
139 |
|
|
140 |
/** |
/** |
141 |
* Data::Driver::Proxy -- Multiple stage data fetching and caching |
* DesignPattern::RemoteProxy -- Multiple stage data fetching and caching |
142 |
* |
* |
143 |
* |
* |
144 |
* This class (Data::Driver::Proxy) provides an abstract framework |
* This class (DesignPattern::RemoteProxy) provides an abstract framework |
145 |
* for loading/saving arbitrary data from/to data storages interfaced |
* for loading/saving arbitrary data from/to data storages interfaced |
146 |
* by storage *proxy*-drivers. |
* by storage *proxy*-drivers. |
147 |
* Don't mix these up with the concrete storage *handle*-drivers |
* Don't mix these up with the concrete storage *handle*-drivers |
150 |
* providing a more highlevel, consistent API making |
* providing a more highlevel, consistent API making |
151 |
* it easier for Data::Driver::Proxy to do its main work: |
* it easier for Data::Driver::Proxy to do its main work: |
152 |
* |
* |
153 |
|
* quote from: http://home.earthlink.net/~huston2/dp/proxy.html |
154 |
|
* "A remote proxy provides a local representative for an |
155 |
|
* object that resides in a different address space. This is |
156 |
|
* what the "stub" code in RPC and CORBA provides." |
157 |
|
* |
158 |
|
* |
159 |
* Multiple stage data fetching and caching: |
* Multiple stage data fetching and caching: |
160 |
* |
* |
161 |
* <pre> |
* <pre> |
208 |
* An attempt to implement some software design patterns |
* An attempt to implement some software design patterns |
209 |
* --- RemoteProxyPattern |
* --- RemoteProxyPattern |
210 |
* |
* |
211 |
|
* @link http://www.agcs.com/supportv2/techpapers/patterns/papers/tutnotes/sld017.htm |
212 |
|
* @link http://home.earthlink.net/~huston2/dp/proxy.html |
213 |
|
* @link http://wiki.cs.uiuc.edu/PatternStories/RemoteObject |
214 |
* @link http://c2.com/cgi-bin/wiki?ProxyPattern |
* @link http://c2.com/cgi-bin/wiki?ProxyPattern |
215 |
|
* @link http://c2.com/cgi-bin/wiki?LazyProxies |
216 |
* |
* |
217 |
* @author Andreas Motl <andreas.motl@ilo.de> |
* @author Andreas Motl <andreas.motl@ilo.de> |
218 |
* @link http://www.netfrag.org/~joko/ |
* @link http://www.netfrag.org/~joko/ |
222 |
* @link http://www.gnu.org/licenses/lgpl.txt |
* @link http://www.gnu.org/licenses/lgpl.txt |
223 |
* |
* |
224 |
* @package org.netfrag.glib |
* @package org.netfrag.glib |
225 |
|
* @subpackage DesignPattern |
226 |
* @name DesignPattern::RemoteProxy |
* @name DesignPattern::RemoteProxy |
227 |
* |
* |
228 |
* |
* |
229 |
* @todo |
* @todo extend options to en-/disable caching via a) session and/or b) database |
230 |
* <pre> |
* make feature available via runtime setter-method to these options |
231 |
* x extend options to en-/disable caching via a) session and/or b) database |
* @todo PEAR::Cache for caching purposes!!! |
232 |
* o make feature available via runtime setter-method to these options |
* @todo refactor database access: use PEAR for this! no more 'connectdb' here!!! |
233 |
* o use PEAR::Cache for caching purposes!!! |
* @todo make database connection more flexible to make possible |
234 |
* o refactor database access: use PEAR for this! no more 'connectdb' here!!! |
* to have different (probably named) proxy databases (besides a "main database") |
235 |
* o make database connection more flexible to make possible |
* @todo rename this to Data::Proxy? or split into Data::Query, Data::Result and Data::Wrapper? |
236 |
* to have different (probably named) proxy databases (besides a "main database") |
* @todo refactor this to a "RemoteObject" class!!! (inheriting from DesignPattern::RemoteObject) |
237 |
* o rename this to Data::Proxy? or split into Data::Query, Data::Result and Data::Wrapper? |
* @todo rename this to "DesignPattern::LazyRemoteProxy"??? |
|
* </pre> |
|
238 |
* |
* |
239 |
*/ |
*/ |
240 |
class DesignPattern_RemoteProxy extends DesignPattern_Proxy { |
class DesignPattern_RemoteProxy extends DesignPattern_Proxy { |
289 |
session_register_safe("proxy"); |
session_register_safe("proxy"); |
290 |
} |
} |
291 |
|
|
292 |
|
/** |
293 |
|
* <!-- Autodia --> |
294 |
|
* can do: (this is metadata supplied for Autodia, don't delete!) |
295 |
|
* $this->backend = new DataSource_Proxy_XMLRPC() |
296 |
|
* |
297 |
|
*/ |
298 |
|
|
299 |
if ($this->meta[remote]) { |
if ($this->meta[remote]) { |
300 |
//$this->backend = mkObject('Data::Driver::RPC::Remote', $this->meta[rpcinfo]); |
//$this->backend = mkObject('Data::Driver::RPC::Remote', $this->meta[rpcinfo]); |
301 |
$this->backend = php::mkComponent('DataSource::Proxy::XMLRPC', $this->meta[rpcinfo]); |
$this->backend = php::mkComponent('DataSource::Proxy::XMLRPC', $this->meta[rpcinfo]); |