Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!bloom-beacon!eru!hagbard!sunic!kth.se!news From: d87-mra@dront.nada.kth.se (Magnus Ramstr|m) Newsgroups: comp.lang.c++ Subject: Re: Smalltalk-like classes Message-ID: <1990Sep13.061908.1032@kth.se> Date: 13 Sep 90 06:19:08 GMT References: <57379@microsoft.UUCP> <1990Sep13.011214.24799@cs.columbia.edu> Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 36 In article <1990Sep13.011214.24799@cs.columbia.edu> kearns@cs.columbia.edu (Steve Kearns) writes: >One of the biggest pains of smalltalk-like classes is that >to understand one class may require scanning four or five classes >(the inherited ones). This is neccessary to find out all the functions >and variables that make up a derived object. > >This goes against one of the fundamental principles of object oriented >programming: a class encapsulates all the functions and data that comprise >an object. > Correct, but one "class level" defines properties added to, deleted from or replacing properties in the superclass(es). The class consists of this and inherited properties. > >.... >A better solution seems to be the following: soon we will all be using >nifty class browsers. I would suggest that these class browsers >automatically copy the inherited items (and their documentation, >please) into the subclass with the inherited keyword, or else in >italics, or prefixed with the superclass name. > >The benefit of all this, I repeat, is that one would have to look at >exactly 1 class to understand 1 class. This is a good idea, providing that only the documentation and absolutely not the implementation is copied. The subclass has no interest what so ever in the implementation of superclass methods, only the interface. When creating a subclass it is valuable to know what is already implemented. When implementing new methods, there is no differance between messages it can send to super and messages it can send to any object accessible from the method. >-steve /Magnus. d87-mra@nada.kth.se (Magnus Ramstr|m). Student @ Dep. of Computer Science.