This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Inheritance in datasheets ====== Inheritance is an essential notion in the creation of a set of DS, to avoid repeating itself. This makes it possible to inherit characteristics of a parent DS, and even to rewrite on some, and even to make it possible not specifying "everything again" when we realize a set of DS have common characteristics. For example, imagine an object ''my object'' that can have four characteristics A, B, C and D, having between 0 and 10 as values. One could have: <WRAP left 40%> <code=xml my_object01> A = 2 B = 3 C = 4 D = 5 </code> </WRAP> <WRAP left 40%> <code=xml my_object02> A = 2 B = 3 C = 4 D = 9 </code> </WRAP> <WRAP clear></WRAP> One sees that A, B and C are identical in the two different objects, one could thus simplify the task by making a parent DS: <WRAP left 40%> <code=xml my_object> A = 2 B = 3 C = 4 </code> </WRAP> <WRAP clear></WRAP> Then we call it the other two: <WRAP left 40%> <code=xml my_object01> parent = my_object D = 5 </code> </WRAP> <WRAP left 40%> <code=xml my_object02> parent = my_object D = 9 </code> </WRAP> <WRAP clear></WRAP> In addition to not allowing repeating itself, it allows to pass on any change in a "parent" to all of his/her children. One can nevertheless decide to specify a difference(with respect to the "parent"), which makes it possible to modify a common characteristic. <WRAP left 40%> <code=xml my_object03> parent = my_object B = 7 D = 5 </code> </WRAP> <WRAP clear></WRAP> In DS, parenting is done through the call: <code=xml> <PARENT Filename="xxxx.sitem"/> </code> It is advisable to organize the [[en:rcdsnomenclature | DS nomenclature]] in order to be able to identify it quickly, and also to quickly identify a parent of a complete card.. by doing it like this: * Put an underscore "_" at the beginning of parents' names to make them come up first in a directory listing; * Use underscores "_" for name fields, like for example the code shipped with RC. This lets you know which parameters are populated and which ones are absent if the nomenclature is explicit. <WRAP center round tip 60%> Of course, a parent DS can call one or more parents, etc. \\ Attention to inheritances in cascade(as in CSS). </WRAP> {{tag>datasheet }}