The paper states that by using cShape function, it has drawn shapes that look like a star, a rectangle, and a diamond. Even though these three shapes have a lot in common, it is recognized as three different shapes. The inheritance builds a set of classes to recreate this taxonomy without copying a lot of code. Member functions common to all shapes are found only in cShape. Member functions with code tailored for each particular shape type are found in each particular directory. Inheritance is the glue that allows to build the hierarchy and allows MATLAB to find the appropriate function.
Constructing Simple Hierarchies with Inheritance, Page 1 of 2
< Previous page Next page > /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch12-1.gif /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch12-2.gif