Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!wuarchive!usc!ucsd!ucbvax!agate!shelby!neon!agesen From: agesen@Neon.Stanford.EDU (Ole Agesen) Newsgroups: comp.object Subject: Should classes be objects Summary: O-O Programming is modelling Keywords: Garfield Message-ID: <1990Aug30.222809.291@Neon.Stanford.EDU> Date: 30 Aug 90 22:28:09 GMT References: <141522@sun.Eng.Sun.COM> Organization: Computer Science Department, Stanford University Lines: 44 In article <141522@sun.Eng.Sun.COM> pallas@red-dwarf.Sun.COM (Joseph Pallas) writes: >>All this, however, still leaves the original question unanswered: >>"WHY SHOULD CLASSES BE OBJECTS?" I would also like to know! > >Why not? Object-oriented programming languages have the manipulation >of objects as their foundation. So, if you want to manipulate >classes, make them objects. Let me try to say why I think classes and objects should be considered different. This is to some extent a matter of perspective. I belong to the "modelling camp", i.e. I consider object-oriented programming to be modelling. A program EXECUTION consists of a set of interacting objects and it is a physical model of a part of the real world. The objects (and the actions they perform) reflect real world phenomena (and the actions they perform). The program execution is generated according to a prescription, the program, which at the same time is a description of the real world part. Real world phenomena are characterized by means of concepts, which have classes as their model system counterpart. So objects reflect phenomena, but classes reflect concepts. Phenomena have substance that change through interactions. Objects model this by encapsulating state that change as a result of methods being invoked. In contrast, concepts have no substance and perform no actions, hence their model system counterparts, classes, should not have state or define methods. Conclusion: classes are not objects since they encapsulate no state, and do not perform action sequences. More details can be found in: O. L. Madsen and B. Moeller-Pedersen: "What object-oriented programming may be - and what it does not have to be" (in ECOOP'88). Admitted: Smalltalk suggest a somewhat different perspective on programming. This results in flexibility, but also in some conceptual problems that are not found above, most notably the meta class regression (classes are instances of meta classes that are instances of ...) Ole >P.S. Is there any easy way to get hold of a copy of this? >>"Persistent and Shared Objects In BETA"; O. Agesen, S. Froelund, M. H. Olsen; >>Masters thesis, Daimi IR-89; April 1989, Computer Science Department, Aarhus >>University, Denmark. Try asking Mr. Elmer Sandvad, ess@mjolner.dk, but no promise!