Templates

So Property Sets in the Casbah Virtual Namespace function as a data modelling convention for describing data somewhere between no documentation at all and full-bore language-based object and class modelling. Property Sets, which have an "instance" associated with them, a "Template", are stored under in the Casbah Virtual Namespace at /models. The Template of a Property Set is like a read-only copy of the table, which the Property Set defines, with empty or good defaults as the values of the keys. The Template can be copied to create a new table in the Casbah Virtual Namespace. "/models" will also expand in the future to support NewtonScript and Self-like "prototypes", XML document types and schemas, etc.

The terms "model" or "template" can also be used to describe any reusable organization of tables or properties, even if they are not yet documented in /models.

In addition to being copied as-is, related templates may also be merge-copied. For example, a message both mailed and posted to UseNet would be merged from the mail-message and news-message templates.

An example of a template would be the description of a mail message:

NAME

 mail-message -- a template for mail messages

SYNOPSIS

 # Properties common (inherited) from `message'
    from     -- string or person object
    date     -- date message was sent
    subject  -- subject of message (plain text)

 # Properties specific to mail messages
    to       -- string or person objects
    received -- ordered list of sites this message passed through

DESCRIPTION

 Mail messages . . .

This Property Set would be stored in the Casbah Virtual Namespace together with an associated Template:

  /models/org/casbah/mail-message/docs     -- the doc above, in XML
                                 /template -- a skeleton mail message
                                 /template/from     -- empty
                                 /template/date     -- empty
                                 /template/subject  -- empty
                                 /template/to       -- empty
                                 /template/received -- empty list