19: Defining Attributes
- 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.
- Each attribute has an automatically assigned property unless it's calculated
- Creating an attribute identifier
- Can be the same as attribute names in other classes
- Declaring the status of an attribute
- Declaring an abstract attribute with the "abstract" keyword
- An abstract attribute can't specify a nonstandard getter or setter operation. (A nonabstract attribute can.)
- Declaring a sealed attribute with the "sealed" keyword so the attribute can't be reimplemented in subclasses
- Declaring a sponsored op with the "sponsored" keyword
- Defer discussion of sponsorship until the Process section of this book.
- Setting a read/write or readonly attribute (using the "readonly" keyword)
- Declaring the type and passage of the attribute
- Specifying exceptions for the attribute
- Using the "with" keyword to define a nonstandard getter and/or setter
- Follow it with "get" and (if not read/write) "set" operations.
- These operations have specific requirements for values accepted and returned.
- 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.