fieldnames.m
-
PDF
245.037109375Kb
With subsref and subsasgn, it sets up public as a new category of member variables. In the tailored display function, it struggled to generate the structure-like output because a separate list of public variables is not available. The paper tailors fieldnames as a way to provide that list. The fieldnames function also plugs a leak in encapsulation. The built-in version of fieldnames returns a list of private names, a behavior it cannot tolerate. Tailoring fieldnames also improves the modularity in the group-of-eight implementation. For example, in display we were forced to add public names to the implementation. Other functions in the group of eight also need access to the names. By including a member function that returns the public list, it can reduce the number of places where public names are repeated. Based on its role with structures, a tailored version of fieldnames is the logical place for the list to exist.
fieldnames.m, Page 1 of 2
< Previous page Next page > /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch6-1.gif /docserver/preview/fulltext/books/pc/sbpc001e/SBPC001E_ch6-2.gif