|
233.
|
|
|
This inheritancy is usually called "class inheritance" in Object oriented design. The child inherits data (fields) and behavior (functions) of his parent.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:528
../../source/developer/03_modules_2.rst:193
|
|
234.
|
|
|
Example 2::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:531
../../source/developer/03_modules_2.rst:198
|
|
235.
|
|
|
_name != _inherit
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:546
../../source/developer/03_modules_2.rst:213
|
|
236.
|
|
|
In this example, the 'other_material' will hold all fields specified by 'network.material' and it will additionally hold a new field 'manuf_warranty'. All those fields will be part of the table 'other.material'. New instances of this class will therefore never been seen by views or trees operating on the superclasses table 'network.material'.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:548
../../source/developer/03_modules_2.rst:215
|
|
237.
|
|
|
This type of inheritancy is known as "inheritance by prototyping" (e.g. Javascript), because the newly created subclass "copies" all fields from the specified superclass (prototype). The child inherits data (fields) and behavior (functions) of his parent.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:550
../../source/developer/03_modules_2.rst:221
|
|
238.
|
|
|
Inheritance by Delegation
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:553
|
|
239.
|
|
|
**Syntax :**::
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:555
../../source/developer/03_modules_2.rst:232
|
|
240.
|
|
|
The object 'tiny.object' inherits from all the columns and all the methods from the n objects 'tiny.object_a', ..., 'tiny.object_n'.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:565
../../source/developer/03_modules_2.rst:245
|
|
241.
|
|
|
To inherit from multiple tables, the technique consists in adding one column to the table tiny_object per inherited object. This column will store a foreign key (an id from another table). The values *'name_col_a' 'name_col_b' ... 'name_col_n'* are of type string and determine the title of the columns in which the foreign keys from 'tiny.object_a', ..., 'tiny.object_n' are stored.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:567
|
|
242.
|
|
|
This inheritance mechanism is usually called " *instance inheritance* " or " *value inheritance* ". A resource (instance) has the VALUES of its parents.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
../../source/developer/02_architecture.rst:569
../../source/developer/03_modules_2.rst:254
|