Whenever value provider belongs to an object, it effectively becomes a property holder for this object.
There are 4 types of standard properties:
- Pro - read only
- Pro.Mutable - read/write, aliased as Pro.M
- Pro.Observable - read/listenTo, aliased as Pro.O
- Pro.ObservableMutable - read/write/listenTo, aliased as Pro.OM
The inheritance graph looks like:
Pro.O / \ Pro Pro.OM \ / Pro.M
By Scalqa convention, method names, which return Pro type, are ended with '_*' instead of word 'Property'
Here is an example of 'name' property definition hierarchy:
trait Foo: // 'name' is read only def name_* : Pro[String] def name : String = name_*() // required shortcut trait Foo_M extends Foo: // 'name' is read/write def name_* : Pro.M[String] def name_=(v:String): Unit = name_*() = v // required shortcut trait Foo_O extends Foo: // 'name' is read/listenTo def name_* : Pro.O[String] trait Foo_OM extends Foo_O with Foo_M: // 'name' is read/write/listenTo def name_* : Pro.OM[String]
Note. The 'required shortcuts' must be implemented. They will not even show up in documentation, because they are assumed to be there