19: Defining Attributes

  1. Attributes have an automatically defined getter operation and (if read/write) a setter operation that can only be used through assignment statements in a block.
  2. Each attribute has an automatically assigned property unless it's calculated
  3. Creating an attribute identifier
    1. Can be the same as attribute names in other classes
  4. Declaring the status of an attribute
    1. Declaring an abstract attribute with the "abstract" keyword
      1. An abstract attribute can't specify a nonstandard getter or setter operation. (A nonabstract attribute can.)
    2. Declaring a sealed attribute with the "sealed" keyword so the attribute can't be reimplemented in subclasses
    3. Declaring a sponsored op with the "sponsored" keyword
      1. Defer discussion of sponsorship until the Process section of this book.
  5. Setting a read/write or readonly attribute (using the "readonly" keyword)
  6. Declaring the type and passage of the attribute
  7. Specifying exceptions for the attribute
  8. Using the "with" keyword to define a nonstandard getter and/or setter
    1. Follow it with "get" and (if not read/write) "set" operations.
    2. These operations have specific requirements for values accepted and returned.
    3. Leaving out a getter or setter when one is required results in the standard getter or setter operation used for the attribute.

TS Ref - 26 JUN 1996

Generated by the sweat of Mike Boom's brow.