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