Xref: utzoo comp.lang.c++:4525 comp.lang.smalltalk:1323 comp.lang.eiffel:383 Path: utzoo!utgpu!watmath!att!dptg!rutgers!cs.utexas.edu!csd4.csd.uwm.edu!wuarchive!swbatl!uucigj From: uucigj@swbatl.UUCP (3531) Newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel Subject: When to make a parent class Keywords: class levels, parent class Message-ID: <760@swbatl.UUCP> Date: 31 Aug 89 12:39:30 GMT Organization: Southwestern Bell Tele. Co. - Advanced Technology Lab - St. Louis Lines: 36 Please excuse: 1 - the cross posting, the comp.object is not out yet. 2 - me if this was asked before, I just came up against it. What I have is the following: I am making a new class and have defined most of the important methods. Now I look at the classes that are already established and look for some common functionality. I find a class (foo) that has almost every thing that my new class needs except there are several methods that I definitely do not need in my new class. And now my questions: I understand that there is no right answer to this but I would like to get a general feeling as to what to do with the methods that do not fit my new class. Do I 1) make my class a sub class and stub out the methods that don't fit, 2) go above foo and put a new class between foo and its parent and leave out the methods that I don't need for my class and then sub class off of this new class, or 3) do something else ? Something that I think affects this, is the number of methods that don't fit. If you were to do 1 before 2 what is the point that makes you go to 2? Since this probably has been talked about before (and maybe even flamed), please e-mail responses. Gregg Jensen ---------------------------------------------------------------------- These opinions are my own and do not necessarily reflect my companies. Southwestern Bell Telephone Send E-MAIL to the following address... ...!uunet!swbatl!uucigj ----------------------------------------------------------------------