| | 1 | """Dejavu is an Object-Relational Mapper. This is version 1.2.5. |
|---|
| | 2 | |
|---|
| | 3 | Persisted objects are called "Units", and are served into Sandboxes within |
|---|
| | 4 | an Arena. Each Unit instance has a class, which maintains its schema via |
|---|
| | 5 | Unit Properties. |
|---|
| | 6 | |
|---|
| | 7 | "Dejavu", to quote Flying Circus episode 16, means "that strange feeling |
|---|
| | 8 | we sometimes get that we've lived through something before." What better |
|---|
| | 9 | name for an object server? Our terminology reflects this cognitive bent: |
|---|
| | 10 | sandboxes "memorize", "recall" and "forget" Units. |
|---|
| | 11 | |
|---|
| | 12 | Most Unit lifecycles follow the same pattern: |
|---|
| | 13 | aUnit = sandbox.unit(cls, ID=ID) |
|---|
| | 14 | val = aUnit.propertyName |
|---|
| | 15 | aUnit.propertyName = newValue |
|---|
| | 16 | del aUnit # or otherwise release the reference, e.g. close the scope. |
|---|
| | 17 | |
|---|
| | 18 | When creating new Units, a similar pattern would be: |
|---|
| | 19 | newUnit = unit_class() |
|---|
| | 20 | newUnit.propertyName = newValue |
|---|
| | 21 | sandbox.memorize(newUnit) |
|---|
| | 22 | del newUnit # or otherwise release the reference. |
|---|
| | 23 | |
|---|
| | 24 | Using recall(), you get an iterator: |
|---|
| | 25 | for unit in sandbox.recall(cls, expr): |
|---|
| | 26 | do_something_with(unit) |
|---|
| | 27 | |
|---|
| | 28 | You destroy a Unit via Unit.forget(). |
|---|
| | 29 | |
|---|
| | 30 | Applications only need to call Unit.repress() when they wish to stop |
|---|
| | 31 | caching the object, returning it to storage. This is very rare, and |
|---|
| | 32 | should really only be performed within dejavu code. |
|---|
| | 33 | |
|---|
| | 34 | |
|---|
| | 35 | LICENSE |
|---|
| | 36 | ------- |
|---|
| | 37 | This work, including the source code, documentation |
|---|
| | 38 | and related data, is placed into the public domain. |
|---|
| | 39 | |
|---|
| | 40 | The original author is Robert Brewer, Amor Ministries. |
|---|
| | 41 | fumanchu@amor.org |
|---|
| | 42 | svn://casadeamor.com/cation/trunk |
|---|
| | 43 | |
|---|
| | 44 | THIS SOFTWARE IS PROVIDED AS-IS, WITHOUT WARRANTY |
|---|
| | 45 | OF ANY KIND, NOT EVEN THE IMPLIED WARRANTY OF |
|---|
| | 46 | MERCHANTABILITY. THE AUTHOR OF THIS SOFTWARE |
|---|
| | 47 | ASSUMES _NO_ RESPONSIBILITY FOR ANY CONSEQUENCE |
|---|
| | 48 | RESULTING FROM THE USE, MODIFICATION, OR |
|---|
| | 49 | REDISTRIBUTION OF THIS SOFTWARE. |
|---|
| | 50 | """ |
|---|
| | 51 | |
|---|