Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.eiffel Subject: Re: Three ways to use library-like classes Message-ID: <3295@enea.se> Date: 1 May 91 22:23:28 GMT Article-I.D.: enea.3295 References: <1991Apr30.140340.25415@bony1.bony.com> Organization: Enea Data AB, Sweden Lines: 27 Also sprach Richard Bielak (richieb@bony1.UUCP): >I have seen two different ways of using classes that are >"library-like" (I mean classes like SINGLE_MATH, which only contain >various math routines, or classes that only define constants). I >thought of a third way to use these, that seems (to me anyway) a >little cleaner. Here are the three ways, I'll use SINGLE_MATH as an example: > >1) Inherit ... >2) Attribute ... >3) Expanded attribute (my way :-) Interesting. I have been thinking on this problem too. I don't like inheriting BASIC just because I need some routine from it. It opens for confusion for me with names coming out of nowhere. And people who inherit from me, may be surprised when BASIC is turning up where they don't expect. And my class uses BASIC, it is not a BASIC. I had in my mind a language change, adding a Library clause under which you would mention class which you referred to without objects directly through the class name. Now, Richard's idea with expanded attributes gives me this without a language change at the cost of an extra identifier. I think I can live with it. Thanks, Richard! -- Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se Le fils du maire est en Normandie avec beaucoup de medecins.