5 |
* It acts as a container for DataSource connection |
* It acts as a container for DataSource connection |
6 |
* metadata. Think of it as an enhanced dsn. |
* metadata. Think of it as an enhanced dsn. |
7 |
* |
* |
8 |
* It gets used by DataSource::GenericDataSource |
* It gets used by DataSource::Generic |
9 |
* to be informed about the most important stuff it |
* to be informed about the most important stuff it |
10 |
* has to do. |
* has to do. |
11 |
* |
* |
19 |
* $Id$ |
* $Id$ |
20 |
* |
* |
21 |
* $Log$ |
* $Log$ |
22 |
|
* Revision 1.3 2003/03/05 15:21:54 joko |
23 |
|
* updated docu (phpDocumentor testing....) |
24 |
|
* |
25 |
* Revision 1.2 2003/03/05 15:01:10 joko |
* Revision 1.2 2003/03/05 15:01:10 joko |
26 |
* updated docu |
* updated docu |
27 |
* |
* |
32 |
*/ |
*/ |
33 |
|
|
34 |
/** |
/** |
35 |
* It helps GenericDataSource working in different "operation modes". |
* It helps DataSource::Generic working in different "operation modes". |
36 |
* |
* |
37 |
* o Pass-Through-Reference: php Object will get passed through all layers |
* o Pass-Through-Reference: php Object will get passed through all layers |
38 |
* o Pass-Through-Memory: reference to a memory area will get used |
* o Pass-Through-Memory: reference to a memory area will get used |
39 |
* x Build-Locator: build locator from datasource-type and adapter-type |
* + Build-Locator: build locator from datasource-type and adapter-type |
40 |
* o Use-Locator: directly use DataSource::Locator instance passed in |
* o Use-Locator: directly use DataSource::Locator instance passed in |
41 |
* o Merge-Locators: merge metadata of two or more DataSource::Locator instances |
* o Merge-Locators: merge metadata of two or more DataSource::Locator instances |
42 |
* o Build-AutoLocator: use global constants making up our metadata |
* o Build-AutoLocator: use global constants making up our metadata |
43 |
* |
* |
44 |
* |
* |
45 |
* It can/should contain (flexible, just some parameters are required for each operation mode) |
* <b>It can/should contain (flexible, just some parameters are required for each operation mode)</b> |
46 |
* |
* |
47 |
* o an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR) |
* o an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR) |
48 |
* + name of a Proxy module to use to *wrap/hide* the connection/transport-layer |
* + name of a Proxy module to use to *wrap/hide* the connection/transport-layer |
52 |
* this will get propagated (pass-through-mode) |
* this will get propagated (pass-through-mode) |
53 |
* + a datasource-type (of 'rpc|mysql|csv-file|xml-file') |
* + a datasource-type (of 'rpc|mysql|csv-file|xml-file') |
54 |
* this will be mapped to a module name and used as a *Proxy* |
* this will be mapped to a module name and used as a *Proxy* |
55 |
* by the GenericDataSource at runtime |
* by the DataSource::Generic at runtime |
56 |
* + an adapter-type (of 'phpHtmlLib|pear') |
* + an adapter-type (of 'phpHtmlLib|pear') |
57 |
* this will be mapped to a module name and used as an *Adapter* |
* this will be mapped to a module name and used as an *Adapter* |
58 |
* by the GenericDataSource at runtime |
* by the DataSource::Generic at runtime |
59 |
* o names of global constants where to find these informations |
* o names of global constants where to find these informations |
60 |
* o datasource-type ('rpc|csv-file|...') <-> datasource-family ('orm|rdbms|odbms') |
* o datasource-type ('rpc|csv-file|...') <-> datasource-family ('orm|rdbms|odbms') |
61 |
* |
* |
62 |
* |
* |
63 |
* --- It can do |
* --- It can do |
64 |
* x builds a larger locator from a minimum of information passed in via constructor-arguments |
* + builds a larger locator from a minimum of information passed in via constructor-arguments |
65 |
* o direct fallback mode to some predefined constant names if locator is empty and above method fails |
* o direct fallback mode to some predefined constant names if locator is empty and above method fails |
66 |
* o direct fallback mode to some predefined values if just *everything* fails |
* o direct fallback mode to some predefined values if just *everything* fails |
67 |
* |
* |
68 |
* |
* |
69 |
* --- How to use? |
* --- How to use? |
79 |
* [adapter_type => 'phpHtmlLib',] |
* [adapter_type => 'phpHtmlLib',] |
80 |
* metadata => array( Host => 'localhost', Port => '8765' ), |
* metadata => array( Host => 'localhost', Port => '8765' ), |
81 |
* ); |
* ); |
82 |
* $source = new GenericDataSource($locator); |
* $source = new DataSource::Generic($locator); |
83 |
* $this->set_data_source( &$source ); |
* $this->set_data_source( &$source ); |
84 |
* |
* |
85 |
* 2. [proposal] for common/oldschool datahandles.... |
* 2. [proposal] for common/oldschool datahandles.... |
86 |
* $locator = array( |
* $locator = array( |
87 |
* dsn => 'known dsn markup', |
* dsn => 'known dsn markup', |
88 |
* ); |
* ); |
89 |
* $source = new GenericDataSource($locator); |
* $source = new DataSource::Generic($locator); |
90 |
* $this->set_data_source( &$source ); |
* $this->set_data_source( &$source ); |
91 |
* |
* |
92 |
* |
* |
173 |
// name of an Adapter module |
// name of an Adapter module |
174 |
var $_adapter_type; |
var $_adapter_type; |
175 |
|
|
176 |
// additional information required (passed on to the Proxy by GenericDataSource) |
// additional information required (passed on to the Proxy by DataSource::Generic) |
177 |
var $_metadata = array(); |
var $_metadata = array(); |
178 |
|
|
179 |
//var $_dsn; |
//var $_dsn; |
287 |
$metadata = array( |
$metadata = array( |
288 |
//package => 'Data::Driver::Proxy', |
//package => 'Data::Driver::Proxy', |
289 |
//package => 'DataSource::Proxy::XMLRPC', |
//package => 'DataSource::Proxy::XMLRPC', |
290 |
//package => 'DataSource::GenericDataSource', |
//package => 'DataSource::Generic', |
291 |
//package => 'DesignPattern::RemoteProxy', |
//package => 'DesignPattern::RemoteProxy', |
292 |
Host => RPC_HOSTNAME, |
Host => RPC_HOSTNAME, |
293 |
Port => RPC_PORT, |
Port => RPC_PORT, |