An important facet of parent-child inheritance is the child's ability to tailor any function that would otherwise be conveyed from the parent. The child-class functions didn't do anything other than slice and forward. They couldn't do much more than that because the child classes inherited all of their data from the parent. Closely related to member function tailoring is the child's ability to go beyond inheritance by adding private member variables, public member variables, and member functions. Adding new m-files is straightforward. Adding new public member variables is a little more difficult because additional variable names need to be incorporated in the group-of-eight functions. Supporting these additions is exactly the reason behind the organization of get.m and set.m. These functions contained slice-and-forward sections only. There was no reason to include sections for public or concealed variables because cStar and cDiamond had none. The paper adds a public variable to cStar and examine the effects on both the implementation and inheritance.
Child-Class Members, Page 1 of 2
< Previous page Next page > /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch14-1.gif /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch14-2.gif