Changeset 2061e31486f948b64c509cf31ce47b4ad863a8c9

Show
Ignore:
Timestamp:
02/24/08 23:48:07 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1203896887 +0000
git-parent:

[e94ac86cedca471ff4fd242d9f1e2d27d4259428]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1203896887 +0000
Message:

further describe the inheritance

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/README.txt

    ra136e61 r2061e31  
    4141the youngest/deepest node is reached. 
    4242 
    43 === Example: === 
     43==== Example ==== 
    4444 
    4545      <a foo="bar"> 
     
    7575approaches: "express yourself once and reuse." 
    7676 
     77=== Explicit Inheritance === 
     78 
     79Sometimes it is useful to define a configuration table key/value set 
     80for reuse, but the strict parent-child inheritance model is awkward. 
     81Under these circumstances, the explicit inheritance often solves the 
     82issue at hand.  With explicit inheritance, a configuration can inherit 
     83from another named node elsewhere in the configuration. 
     84 
     85The <config /> stanzas can be identified, as is typical in XML, with 
     86the "id" attribute: <config id="sample" />.  Additionally, any config 
     87may explicitly specify that it inherits from a named config by 
     88specifying the "inherit" attribute. 
     89 
     90Any <config />, A, which has the "inherit" attribute will first 
     91inherit from its most direct parent, then supplement/replace those 
     92key/values with the configuration whose "id" attribute matches the 
     93"inherit" attribute of A, and finally supplement/replace those 
     94key/values with key/values directly beneath A.  The entire tree is 
     95searched for a node whose "id" matches A's "inherit" attribute. 
     96 
     97==== Example ==== 
     98 
     99  <config name="A"> 
     100    <key1>a</key1> 
     101    <key2>b</key2> 
     102    <key3>c</key3> 
     103    <config name="C" inherit="bob"> 
     104      <key1>AAA</key1> 
     105      <key4>DDD</key4> 
     106    </config> 
     107  </config> 
     108  <x> 
     109    <y> 
     110      <z> 
     111        <config name="B" id="bob"> 
     112          <key2>bobB</key2> 
     113          <key5>bobE</key5> 
     114        </config> 
     115      </z> 
     116    </y> 
     117  </x> 
     118 
     119The config named "A" contains: 
     120  key1: a 
     121  key2: b 
     122  key3: c 
     123 
     124The config named "C" contains: 
     125  key1: AAA 
     126  key2: bobB 
     127  key3: c 
     128  key4: DDD 
     129  key5: bobE 
     130 
     131It should be noted hat all config's include the one named "B" above 
     132follows this same inheritance model. 
    77133 
    78134== Seciton <eventer>: ==