Contact: fumanchu@aminus.org

Log in as guest/dejavu to create tickets

Changeset 593

Show
Ignore:
Timestamp:
06/04/08 12:43:12
Author:
fumanchu
Message:

Removed all mention of the old 'arena' class from Dejavu docs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dejavu/doc/intro.html

    r592 r593  
    5656the creation of new Units, and their destruction.</p> 
    5757 
    58 <p>Finally, Dejavu provides a core <tt>Arena</tt> class which you should be 
    59 able to leverage for any sort of application you are building. The Arena 
    60 object functions as a top-level "Application" object, collecting the global 
    61 settings for an application into one place. It doles out Sandboxes, 
    62 maintains a registry of Units and their associations, and manages startup 
    63 and shutdown operations.</p> 
     58<p>Finally, Dejavu provides <tt>StorageManager</tt> classes which you should 
     59be able to leverage for any sort of application you are building. There are 
     60Storage Managers for Postgres, MySQL, SQL Server and other databases, as 
     61well as partitioners, caching adapters, file storage adapters, etc. You can 
     62use any of them as a top-level "Application" object, collecting the global 
     63settings for an application into one place. A StorageManager doles out 
     64Sandboxes, maintains a registry of Units and their associations, and 
     65manages startup and shutdown operations.</p> 
    6466 
    6567 
     
    8789Animal.many_to_one('ZooID', Zoo, 'ID') 
    8890 
    89 # Set up a global Arena object. 
    90 arena = dejavu.Arena() 
     91# Set up a Storage Manager. 
    9192conf = {u'Connect': r"PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=C:\zookeeper.mdb;"} 
    92 arena.add_store("main", "access", conf) 
    93 arena.register_all(globals())</pre> 
     93root = storage.resolve("access", conf) 
     94root.register_all(globals())</pre> 
    9495 
    9596<p>The above creates the model for the zookeeper application. 
     
    103104        <li>The association between the Animal class and the Zoo class 
    104105            (many-to-one).</li> 
    105         <li>The setup of a dejavu <tt>Arena</tt> object, including a Storage 
    106             Manager which uses a Microsoft Access (Jet) database.</li> 
     106        <li>The setup of a dejavu <tt>StorageManager</tt> object which 
     107            uses a Microsoft Access (Jet) database.</li> 
    107108    </ol> 
    108109</p> 
     
    112113 
    113114<pre>>>> import zookeeper 
    114 >>> box = zookeeper.arena.new_sandbox() 
     115>>> box = zookeeper.root.new_sandbox() 
    115116>>> box.recall(zookeeper.Animal) 
    116117[&lt;zookeeper.Animal object at 0x013281F0>, &lt;zookeeper.Animal object at 0x01328150>, 
     
    244245Authorship.many_to_one('authorID', Author, 'ID') 
    245246 
    246 arena = Arena(
    247 arena.register_all(globals()) 
     247root = storage.resolve("mysql", conf
     248root.register_all(globals()) 
    248249</pre> 
    249250 
     
    256257<p>To create the tables:</p> 
    257258<pre>for cls in (Author, Publisher, Book): 
    258     arena.create_storage(cls)</pre> 
     259    root.create_storage(cls)</pre> 
    259260 
    260261<p>The app developer's runtime code reads as follows:</p> 
    261262<pre> 
    262 box = arena.new_sandbox() 
     263box = root.new_sandbox() 
    263264ppython = Book(title='Programming Python', price=20, 
    264265               publishDate=datetime.datetime(2001, 3, 1))