Add explanation why we use ref objects

This commit is contained in:
def
2015-03-26 15:59:26 +01:00
parent 748a7b866f
commit 91708bb21d

View File

@@ -83,6 +83,9 @@ no ancestor are implicitly ``final``. You can use the ``inheritable`` pragma
to introduce new object roots apart from ``system.RootObj``. (This is used
in the GTK wrapper for instance.)
We always use ref objects for inheritance in this tutorial. When you store a
non-ref object in a variable of a parent type, the additional fields are cut
off.
**Note**: Composition (*has-a* relation) is often preferable to inheritance
(*is-a* relation) for simple code reuse. Since objects are value types in