Xref: utzoo comp.object:2586 comp.lang.c++:11772 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!ithaca!garry From: garry@ithaca.uucp (Garry Wiegand) Newsgroups: comp.object,comp.lang.c++ Subject: Re: Object-Oriented Metrics Message-ID: <1991Feb21.073010.8592@ithaca.uucp> Date: 21 Feb 91 07:30:10 GMT Organization: Ithaca Software Lines: 25 pkr@media01.UUCP (Peter Kriens) writes: > 6. Too many classes. > ... For example I saw > a class button with a Help, Shuffle and Play subclass. The > only thing these classes did was print their name and > call a procedure. This was much better if the button class > had an instance variable for the name and action. I was arguing exactly this point a few days ago with a MacApp fan. He claimed that overriding a method - by deriving a new class from "Button" - was *exactly* the most elegant way to program menus in MacApp C++. I argued that creating classes for which there would probably only ever be one instance seemed syntactically clumsy (in C++). I argued further that if you instead got involved with pointers-to-functions as part of the Button instance data (as Peter suggests) then you've fallen back into the plain-C style of being object-oriented and thus C++ hasn't done you much good. What's the net.religion on the subject of "too many classes" and, for example, used-only-once menu buttons? Garry Wiegand --- Ithaca Software, Alameda, California ...!uunet!ithaca!garry, garry%ithaca.uucp@uunet.uu.net Brought to you by Super Global Mega Corp .com