/[cvs]/nfo/php/libs/org.netfrag.glib/DataSource/Locator.php
ViewVC logotype

Diff of /nfo/php/libs/org.netfrag.glib/DataSource/Locator.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by joko, Wed Mar 5 15:01:10 2003 UTC revision 1.4 by joko, Wed Mar 5 15:26:23 2003 UTC
# Line 5  Line 5 
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   *   *
# Line 19  Line 19 
19   * $Id$   * $Id$
20   *   *
21   * $Log$   * $Log$
22     * Revision 1.4  2003/03/05 15:26:23  joko
23     * updated docu (phpDocumentor testing....)
24     *
25     * Revision 1.3  2003/03/05 15:21:54  joko
26     * updated docu (phpDocumentor testing....)
27     *
28   * Revision 1.2  2003/03/05 15:01:10  joko   * Revision 1.2  2003/03/05 15:01:10  joko
29   * updated docu   * updated docu
30   *   *
# Line 29  Line 35 
35   */   */
36    
37  /**  /**
38   * It helps GenericDataSource working in different "operation modes".   * It helps DataSource::Generic working in different "operation modes".
  *  
  *    o Pass-Through-Reference: php Object will get passed through all layers  
  *    o Pass-Through-Memory: reference to a memory area will get used  
  *    x Build-Locator: build locator from datasource-type and adapter-type  
  *    o Use-Locator: directly use DataSource::Locator instance passed in  
  *    o Merge-Locators: merge metadata of two or more DataSource::Locator instances  
  *    o Build-AutoLocator: use global constants making up our metadata  
  *  
  *  
  * It can/should contain (flexible, just some parameters are required for each operation mode)  
39   *   *
40   * o an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR)   * - Pass-Through-Reference: php Object will get passed through all layers
41     * - Pass-Through-Memory: reference to a memory area will get used
42     * + Build-Locator: build locator from datasource-type and adapter-type
43     * - Use-Locator: directly use DataSource::Locator instance passed in
44     * - Merge-Locators: merge metadata of two or more DataSource::Locator instances
45     * - Build-AutoLocator: use global constants making up our metadata
46     *
47     * <b>It can/should contain:</b>
48     * (flexible, just some parameters are required for each operation mode)
49     * - an oldschool "dsn"-string (e.g. for rdbms-connection via PEAR)
50   * + 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
51   *   (e.g. DataSource::Proxy::XMLRPC via DesignPattern::RemoteProxy)   *   (e.g. DataSource::Proxy::XMLRPC via DesignPattern::RemoteProxy)
52   * + metadata (a hash) directly describing *where* to connect to (e.g. 'Host', 'Port')   * + metadata (a hash) directly describing *where* to connect to (e.g. 'Host', 'Port')
53   * o an instance of an already instantiated arbitrary datasource handler (e.g. 'source')   * - an instance of an already instantiated arbitrary datasource handler (e.g. 'source')
54   *   this will get propagated (pass-through-mode)   *   this will get propagated (pass-through-mode)
55   * + a datasource-type (of 'rpc|mysql|csv-file|xml-file')   * - a datasource-type (of 'rpc|mysql|csv-file|xml-file')
56   *   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*
57   *   by the GenericDataSource at runtime   *   by the DataSource::Generic at runtime
58   * + an adapter-type (of 'phpHtmlLib|pear')   * + an adapter-type (of 'phpHtmlLib|pear')
59   *   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*
60   *   by the GenericDataSource at runtime   *   by the DataSource::Generic at runtime
61   * o names of global constants where to find these informations   * - names of global constants where to find these informations
62   * o datasource-type ('rpc|csv-file|...') <-> datasource-family ('orm|rdbms|odbms')   * - datasource-type ('rpc|csv-file|...') <-> datasource-family ('orm|rdbms|odbms')
63   *   *
64   *   *
65   * --- It can do   * <b>It can do</b>
66   *    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
67   *    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
68   *    o direct fallback mode to some predefined values if just *everything* fails   * o direct fallback mode to some predefined values if just *everything* fails
69   *   *
70   *   *
71   * --- How to use?   * <b>How to use?</b>
72   *   *
73   * Pass an array holding "locator metadata" to the constructor.   * Pass an array holding "locator metadata" to the constructor.
74   * This module takes care of the rest.   * This module takes care of the rest.
# Line 76  Line 81 
81   *      [adapter_type => 'phpHtmlLib',]   *      [adapter_type => 'phpHtmlLib',]
82   *      metadata => array( Host => 'localhost', Port => '8765' ),   *      metadata => array( Host => 'localhost', Port => '8765' ),
83   *    );   *    );
84   *    $source = new GenericDataSource($locator);   *    $source = new DataSource::Generic($locator);
85   *    $this->set_data_source( &$source );   *    $this->set_data_source( &$source );
86   *   *
87   *  2. [proposal] for common/oldschool datahandles....   *  2. [proposal] for common/oldschool datahandles....
88   *    $locator = array(   *    $locator = array(
89   *      dsn => 'known dsn markup',   *      dsn => 'known dsn markup',
90   *    );   *    );
91   *    $source = new GenericDataSource($locator);   *    $source = new DataSource::Generic($locator);
92   *    $this->set_data_source( &$source );   *    $this->set_data_source( &$source );
93   *   *
94   *   *
# Line 170  class DataSource_Locator { Line 175  class DataSource_Locator {
175      // name of an Adapter module      // name of an Adapter module
176      var $_adapter_type;      var $_adapter_type;
177            
178      // additional information required (passed on to the Proxy by GenericDataSource)      // additional information required (passed on to the Proxy by DataSource::Generic)
179      var $_metadata = array();      var $_metadata = array();
180            
181      //var $_dsn;      //var $_dsn;
# Line 284  class DataSource_Locator { Line 289  class DataSource_Locator {
289          $metadata = array(          $metadata = array(
290            //package => 'Data::Driver::Proxy',            //package => 'Data::Driver::Proxy',
291            //package => 'DataSource::Proxy::XMLRPC',            //package => 'DataSource::Proxy::XMLRPC',
292            //package => 'DataSource::GenericDataSource',            //package => 'DataSource::Generic',
293            //package => 'DesignPattern::RemoteProxy',            //package => 'DesignPattern::RemoteProxy',
294            Host => RPC_HOSTNAME,            Host => RPC_HOSTNAME,
295            Port => RPC_PORT,            Port => RPC_PORT,

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.4

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed