First-class Properties

Definition

  1. Properties are objects (OO sense, not necessarily Scala object declaration sense) that govern access to a (possibly calculated) field. This means properties can have other methods in addition to get/set logic, such as registering event listeners.
  2. Access (including mutation) is syntactically identical to fields (vals/vars)
  3. All logic and/or state of a property is structurally grouped within the property object
  4. Property objects directly are accessible via reflection APIs (on equal footing to methods, fields, etc)
  5. vals and vars are the simplest instances of Properties (the property object was “compiled away” as an optimization and should still be accessible on demand)
  6. Properties have both a “bound” and “unbound” aspect. An unbound property can be used to access its bound counterpart by passing it an instance of the owning object with which to bind.
  7. Properties can be abstract and either specified in a derived class, or receive their implementation via the constructor
 
future/properties.txt · Last modified: 2007/06/30 14:44 by eengbrec
 
Recent changes RSS feed Valid XHTML 1.0 Driven by DokuWiki