Next: , Previous: Creating A Class File, Up: Class Creation



2.3 Required Attributes And Features

**UNFINISHED**

Test.

2.3.1 Attributes

name
A localized string containing the object's name in the MOZ.
storageRef
The storageRef attribute just holds an object reference record for the MOZ's central Storage object. _Every_ object in the MOZ needs to talk to Storage at some point.
languageStringsObjectRef
Holds the global set of localized strings, which all system object should use.
hasProperName
A boolean declaring if the object's name is a proper name (like Alice or Bob) or a generic name (like couch or door or puppy).
verbs
A place to store the list of input verbs that this class recognizes. Note that there are special methods to deal with this structure; it should not be touched directly.
publicMethods
This is a list of methods we let everybody see. In particular, this list is used to give basic capabilities to an object's location, and vice versa.

The list is updated using addPublicMethod.

serverRef
The serverRef attribute just holds an object reference record for the MOZ's central Server object.

2.3.2 Features

ozName
The ozName feature; holds an Oz name value unique to the current object.
exports
The exports feature holds a list of 2-tuples detailing the attributes to be handled by toRecord and fromRecord. In other words, it lists all attributes that need to be saved to disk to preserve the state of a member of this class, so it is very important to fill exports properly.

The 2-tuples are the name of the attribute and its type. Most type atoms are ignored, but some must be specially handled (i.e. object references, which must be mediated by the Storage object).

A minimal example:

              exports: [
                  storageRef#objectRef
                  serverRef#objectRef
                  languageStringsObjectRef#objectRef hasProperName#bool
                  name#string
              ]
     

A more complicated example, with multiple inheritance:

          exports: {Append
              {Record.toListInd
                  {Adjoin
                      {List.toRecord exports Location.exports}
                      {List.toRecord exports Mobile.exports}
                  }
              }
              % Our local exports
              [ language#atom outputPort#notPersistent ]
          }
     

featExports
featExports is just like exports, except for features instead of attributes.

A minimal example:

              featExports: [ ozName#name capabilityDict#dict ]
     

methodList
The methodList feature just holds a list of the names of the methods that the wrapper should make capabilities for, i.e. the externally available methods. Note that upgrade should not be here, because it's handled specially.

A minimal example:

              methodList: [
                  init start stop ozName className toRecord fromRecord revoke
                  hasProperName getName setName deLocalize getVerbs addVerb
              ]
     

A more complicated example, with multiple inheritance:

              methodList: {Append
                  {Merge
                      {Sort Location.methodList Value.'>'}
                      {Sort Mobile.methodList Value.'>'}
                      Value.'>'
                  }
                  % Our local methods.
                  [
                      tell setLanguage getLanguage sayVerb setStorage
                      reloadVerb languagesVerb languageVerb helpVerb
                  ]
              }
     

className
The class name, stored as an atom:
              className: 'MozBase'
     

capabilityDict
The capability dictionary for this object.
wrapper
The active object wrapper procedure for this object.