Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!apple!usc!julius.cs.uiuc.edu!ux1.cso.uiuc.edu!ux1.cso.uiuc.edu!m.cs.uiuc.edu!johnson From: johnson@m.cs.uiuc.edu Newsgroups: comp.object Subject: Re: Redefining (used to be Void referen Message-ID: <77500066@m.cs.uiuc.edu> Date: 24 Nov 90 16:21:00 GMT References: <174653@<1990Nov17> Lines: 53 Nf-ID: #R:<1990Nov17:174653:m.cs.uiuc.edu:77500066:000:2702 Nf-From: m.cs.uiuc.edu!johnson Nov 24 10:21:00 1990 I said: > >Following the Scandianvian tradition, a program provides a model of >some system. When you find that you need to reuse just part of a class >then it means that your model was wrong. Instead of patching up the >code, you should fix your model. Bill Davis (wdavis@x102c.ess.harris.com) said: >I do not agree that "the model was wrong". After you find that you >"want to reuse" part of a class (not "need to resue" - there are always >alternatives), how does that make what went before "wrong". Does >the program you want to reuse parts of no longer work? Does it >fail to perform its function in some way, now that you want to reuse >part of it? Most of the time when I am programming, I am trying to build reusable software. I am trying to describe an entire problem domain, and I expect that the classes that I design will work for any problem in that domain. Thus, the model was wrong because it did not work for a particular member of the domain. A set of classes is like a scientific theory. The individual programs that you build out of these classes are the experiments that test the theory. If the programs require all sorts of weird work-arounds and hacks to work then the theory starts to look like Ptolemaic astronomy looks today. Of course, Ptolemaic astronomy seemed pretty reasonable to astronomers before Copernicus, and we often stick with an outmoded set of classes. Sometimes this is just because it is what we know. Sometimes it is because we invented it. Sometimes it is because we have lots of code that uses it, and it would be too expensive to change. As time goes on, we learn more and more about how we should have designed the classes, and eventually it is worth the price to change. A perfect example is Model/View/Controller. It was the first user interface framework, and every succeeding framework has owed a lot to it. However, it is now a decade old, and is definitely showing its age. Thus, version 4.0 of Smalltalk from ParcPlace has a new version of Model/View/Controller that seems (from the little that I have looked at it) to be a big improvement. It should be easier to learn, it should be easier to customize, and it should be easier to use as a foundation for more reusable components. On the other hand, there is a cost to converting over, both to ParcPlace and to their customers. >If you find that the original model "was wrong" it must be because >the model "was" not correct for the original problem or "is" not >correct for what the original problem is now known to be. Usually the latter. My understanding of a problem improves the longer I work on it. Ralph Johnson -- University of Illinois at Urbana-Champaign