Properties contain object data. Classes define the same properties for all object, but each object can have unique data values. Property attributes control what functions or methods can access the property. You can define functions that execute whenever you set or query property values. Properties can trigger events when code accesses their values.
There are different kinds of properties and each serves a different purpose.
When you define properties you also specify property attributes that control certain aspects of the property's behavior.
Attributes control the behavior of properties.
You can control what code can set property values.
Classes can assign default values to properties and you can change these values during object construction or direct access to the properties.
Use a class with
to define constant values
Properties assigned objects as default values construct that object only once when the class is first loaded. Also, assignment to contained object properties behaves differently depending on whether the object is a handle or value.
You can restrict the class of property values to a specified class.
Property access methods execute code when property values are referenced or assigned. Implementing these methods enables you to control what actions occur when values are set or queried.
Property set methods must follow specific syntax and execution rules.
Property get methods must follow specific syntax and execution rules.
Dependent properties need access methods because these properties do not store values. Property access methods manage interactions with the dependent properties.
You can add instance data to an object derived from
You can implement what are effectively access methods for dynamic properties.
You can define listeners for
on dynamic properties.
to save and load dynamic properties.