Creating Interreality: The Virtual Object System: Version 0.12.0 | ||
---|---|---|
Prev | Chapter 6. Object Type Definitions | Next |
<otd name="NAME" group="GROUP" revision="REV" number="#NUM" extends="EXTENDS LIST" replaces="REPLACES LIST">
This information is supplied as attributes to the root element. It indicates name, repository numbber and revision number of this OTD, and which OTD versions this OTD replaces. It also provides a mechanism for 'extending' an older OTD.
An OTD may "replace" one or more existing OTDs, in which case it should encompass all the functionality of the old OTDs, and for some reason be preferred over the old ones. An application could also try to use an implementation of an older OTD from this list if it can't handle this version.
In addition, another OTD may be "extended", in which case this OTD automatically conatains all the elements from the extended OTD, and the elements appearing in this OTD simply override the same elements in the extended OTD. (This makes versioning alot easier)
Note that "replace" does NOT imply "extend" nor does "extend" imply "replace".
Typically, a new version of an old OTD will replace or extend the old version.
A revision is a compatible or minor change to an OTD for example, editing documentation for grammar/spelling/clarity, or updating informative content such as author or history or replacedby info, or adding optional objects and message fields. Revision starts at 0.
A new OTD should be written when any major features are added, removed or changed, under a new name. The convention for naming new versions is to append a period and a version number to the name (e.g. "type" -> "type.1" -> "type.2"). The "extends" and "replaces" attributes are used to indicate new versions of old OTDs.
The group is used to group related types in code libraries, the repository and documentation, but is not required. The group name is used as a prefix for subobject and method names.
A type's full name is formed by appending this string to the group name, with a colon (if the object has a group): "group:name". This name should be one word (no spaces, commas, etc) of only alphanumeric characters. Underscore ('_') and dash ('-') are also allowed, but not as the first letter. Punctuation characters may be added in the future, with special meaning. Puncutuation characters appended or prepended to the type name may also have special meaning within the internals of an application but should not be considered part of the type name.
Types must have unique names.
A type named "object-core" (Repository #000) will be defined by the developers to contain documentaiton and action definitions implicitly accepted by all MOS objects. In MOS, all objects implicitly implement "object-core", and it should not be included in object type lists.
The naming convention for types which extend other types is to prepend the name of the extended type with a dot (.). For example: "object3D.cube" is the name of a type which extends the "object3D" type.
New major versions should have new names to differentiate them from other versions. The convention for new types is the same as for extended objects: append the version number with a dot (.). For example: "foo.2" could be used for foo version 2.
This number is used to uniquely track and identify each type. It is assigned by the repository editors uppon acceptance.