Path: utzoo!attcan!uunet!grand!day From: day@grand.UUCP (Dave Yost) Newsgroups: comp.lang.eiffel Subject: Re: Feature names (Eiffel tip of the week #2) Keywords: Consistency Message-ID: <493@grand.UUCP> Date: 12 May 89 07:04:05 GMT References: <137@eiffel.UUCP> Reply-To: day@grand.UUCP (Dave Yost) Organization: Grand Software, Inc., Los Angels, CA 213-650-1089 Lines: 22 In article <137@eiffel.UUCP> bertrand@eiffel.UUCP (Bertrand Meyer) writes: > An important aspect of object-oriented design of reusable components >is the proper choice of names for exported features of each class. >The basic rule is that these names should be both simple (which usually >implies that they should be short) and chosen according to consistent >conventions. I am glad to see this revision toward regularization of the feature names in the library. I might add that I think the best way to standardize such names is for them to appear in a very basic deferred class, parent of all similar descendents in which they would be used. For example, a deferred base class COLLECTION could have an "nb_elements" feature, and all descendent COLLECTION classes would be obliged to use that name for the number of items in the collection. So, strings and arrays which are obviously collections would each have an nb_elements, instead of a STRING having a length, and an array having an nb_elements. (My preferred name for this feature would be simply, "size"). --dave