Cover illustration, Martin Lemelman/515 E�itorial Guest Editorial Ada 94-The new OOP standard Richard Riehle Letters to the Editor Modeling & Design Building boxes: Composite objects James Rumbaugh C++ File iterators Andrew Koenig Smalltalk Building an application using HP Distributed Smalltalk WilfLaLonde & John Pugh A Deeper Look ... . . . at translating actions Stephen J. Mellor Ad index Product News Recruitment 4 6 8 12 59 63 71 72 77 79 JOURNAL OF OBJECT-ORIENJED p November-December 1994 Vol. 7, No. 7 Features Time invariant virtual member function dispatching for C++ evolvable classes Roger Voss 23 A technique for implementing a time-invariant virtual member function dispatch for C++ e\'oh·able classes is presented, focusing on matching the efficiency of dispatch of virtual functions for conventional classes. Of utmost importance is economy in memory space, execution time, and compiler implementation complexity. The dispatching scheme presented would be sufficiently flexible to undertake the self configurating architecture the author envisions and couple it to a rather efficient C++ runtime. On the design of encapsulated CLOS applications Charlotte Pii Lunau & Kjeld Larsen 34 Encapsulation is a major objective when designing and implementing large commercial CLOS applica tions. This article identifies a set of objectives necessary to obtain proper encapsulation. CLOS is e\'al uated against the objectives; its deficiencies are described and solutions are proposed and demonstrated through several examples from an industrial application. Modelling the real world: Are classes abstractions or objects? 39 Chris Partridge The system building process should start with a model of the relevant part of the real world, but most 0-0 systems work is concerned with the later stages, taking 0-0 languages as a given and looking at how to use them to build the system. This article discusses the origin of the object paradigm, and demonstrates the value of beginning with real-world modeling using an 0-0 approach . Object Modeling Technique (OMT): Experience report Mohamed E. Fayad, Wei-Tek Tsai, Richard L. Anthony, & Milton L. Fulghum 46 The authors used Rumbaugh's Object Modeling Technique (OMT) for engineering and developing a mis sion planning system. They discuss the positive and negative aspects of the technique and present OMTpro, a hybrid technique they derived from OMT and other software development techniques to solve the issues that arose during development. The JOURNAL OF OBJECT-ORIENTED PROGRAMMING (ISSN #0896-8438) is published nine times a year, monthly except for Mar/Apr, Jul/Aug, and Nov/Dec by SIGS Publications Inc., 71 West 23rd Street, 3rd floor, New York, New York 10010. Please direct advertising inquiries to this address. Second class postage paid at New York, New York, and additional mailing offices. POSTMASTER: Send address changes to JOOP, P.O. Box 2030, Langhorne, PA 19047. Inquiries and new subscription orders should also be sent to that address. Annual subscrip tion rates for the U.S. are $199 for institutions, $69 for individuals. All foreign orders must be prepaid in U.S. funds drawn on a U.S. bank. Canadian & Mexican orders add $25 per year and non-North American orders add $40 per air service. For service on current subscriptions, call 215.785.5996, fax 215.785.6073, e-mail p00976@psilink.com. © Copyright 1994 SIGS Publications Inc. All rights reserved. Reproduction of this material by electronic transmission, Xerox, or any other method will be treated as a willful violation of the US Copyright law and is flatly prohibited. Material may be reproduced with express permission from the publisher. Statements of opinion and fact are made on the responsibility of the authors alone and do not imply an opinion on the part of SIGS PUBLICATIONS INC. or the editorial staff. All trademarks are the property of their respective owners. Manuscripts under review should be typed double spaced (in triplicate) and accompanied by an electronic file in TEXT format. Editorial correspondence and Product News information should be sent to the Editor, Dr. Richard S. Wiener, 135 Rugely Court, Colorado Springs, CO 80906, 719.579.9616 (voice & fax). Printed in the USA. Canada Post International Publications Mail Product Sales Agreement No. 290343. NOVEMBER-DECEMBER 1994 3 -- 1 of 9 -- Editorial IT IS THE TIME of year for big and important OOP conferences. The largest of all OOP conferences, the ACM-sponsored OOPSLA '94, is coming up in three weeks. Object Expo Europe took place last week (September 22-26) in London. This was an outstanding conference that brought together speakers and attendees from North America and Europe. For me it provided an opportunity to meet with some JOOP colum nists, writers, fellow editors, and friends and meet many European readers. I am told that JOOP is being read in over 70 countries. As we complete another year of publication I invite our readers to send letters to the Ed itorial Office or short communications via email (rsweiner@elbert.uccs.edu) that tell us what you like in JOOP and what you would like to see improved. With such a geographically vast readership it is important to receive constructive feedback. This issue contains four feature articles in addition to our many columns. "Time invariant virtual member functions dispatching for C++ evolvable classes" by Roger Voss, is a "revi�ionary supplement to a previous paper entitled, "C++ Evolvable Base Classes Residing in Dynamic Linking Libraries." An evolvable C++ base class is one that can be exported from a shared library and derived from or used in other components. Roger pro poses an efficient scheme for implementing a new method dispatching approach. "On the design of encapsulated CLOS applications" by Charlotte P. Lunau from Aal borg University, Denmark, and Kjeld Larsen from S0ren T. Lyngs0 A/S Research and De velopment Centre, examines the encapsulation mechanisms of CLOS and illustrates with a case-study involving a maritime application. "Modeling the real world: Are classes abstractions or objects?" by Chris Partridge ex amines the initial stage of object-oriented model construction. It shows how an object-ori ented approach provides for "better" models of the real world. "Object modeling techique: An experience report" by Mohamed E. Fayad, Wei-Tek Tsai, Richard L. Anthony, and Milton L. Fulgum, presents an assessment of the OMT approach to object modeling. Hope you enjoy this issue ofJOOP. Stay warm! / Richard S. Wiener 4 JOURNAi.Of OBJECT-ORIENTED .f,� EDITOR Dr. Richard Wiener University of Colorado, Colorado Springs SIGS PUBLICATIONS ADVISORY BOARD Thomas Atwood, Object Design Fran1rois Bancilhon, 02 Technologies Grady Booch. Rational George Bosworth, Digitalk Adele Goldberg, ParcPlace Systems R. Jordan Kreindler, Rational Thomas Love, Morgan Stanley Bertrand Meyer, /SE Meilir Page-Jones, \Vay/and S_i-srcm_.:; Cliff Reeves, IBM Dave Thomas, Object Technology Imemational JOOP EDITORIAL BOARD Daniel Fishman, Hewlett-Packard wbs Stuart Greenfield, Marist College Ivar Jacobson, Objective Systems Boris Magnusson, Lund Unii·ersity Lewis Pinson, University of Colorado Eugene Wang, Symamec COLUMNISTS Steve Cook, Object Designers. Ltd. John Daniels, Object Designers. Ltd. Desmond D'Souza, ICON Computing Richard Gabriel, ParcPlace Robert Howard, Tower Technology Andrew Koenig, AT&T Bell u,b; WilfLalonde, Carleton Unin..,-sity Mary E.S. Loomis, J-{ewlett-Packard Stephen i\lellor, Project Technology James Odell, James Odell Associate, John Pugh, Carleton University James Rumbaugh, Rational Marc Wiener, Product News Editor C. Thomas \Vu, Naval Postgraduate School SIGS PUBLICATIONS, INC. Richard P. Friedman Founder & Group Publisher EDITORIAL/ PRODUCTION Kristina Joukhadar, Managing Editor Andrea Cammarata, Art Director Elizabeth A. Upp, Production Editor Margaret Conti, Advertising Production Coordinator Tanya Trowell, Editorial Assistant Andrea Cammarata, Cover Design CIR CULATION Bruce Shriver, Jr. Circulation Director John R. Wengler, Circulation Manager Kim Maureen Penney, Circulation Analyst ADVERTISING/MARKETING Shirley Sax, Director of Sales Gary Portie, Advertising Manager, East Coast/ Canada! Europe Sales Representative, West Coast: Diane Fuller & Associates 408.255.2991, f: 4-08.255.2992 Kristine Viksnins, Advertising Assistant Michael Peck, Advertising Assistant Sarah Hamilton, Director ofPromotions and Research Caren Polner, Promotions Graphic Artist ADMINISTRATION Margherita R. Monck, General Manager David Chatterpaul, Accounting Manager Jrunes Amenuvor, Bookkeeper Michele Watkins,Assistant to the Publisher Shannon Smith, Administrative Assistant SIGSPUBLICATIONS Publishers of Journal ofObject-Oriented Programming, Object Magazine, C++ Report, Report on Object Analysis & Design, The Smalltalk Report, ObjektSpektrum (Germany), Objects in Europe (London), and TheXJournal. -- 2 of 9 -- Chris Partridge REV-ENG Consulting. email: I 00275.2523@compuserve.com Modelling the real world: Are classes abstractions or objects? T HERE IS CURRENTLY an imbalance in object-oriented ( 0-0) systems work. The system building process starts, or at least should start, with a model of the relevant part of the real world, move through various stages, and finish with a working system. However, most 0-0 systems work is con cerned with the later stages of system building, and little time is given to the early stages. We can see this reflected in curre�t 0-0 lit erature, which focuses on 0-0 programming, and often takes cur rent 0-0 programming languages as a given and considers how to use these to build systems. This is doubly unfortunate as not only is insufficient time spent on considering how to model the real world, but 0-0's superior capabilities in this area are not being realised. This article is an attempt to start redressing the balance. It looks at the initial stage of 0-0 system building-modelling the real world-taking only the notion of an object as a given. It shows how an object-oriented approach at this stage enables us to build better models of the real world and how this, in turn, clarifies a funda mental aspect of the 0-0 paradigm-revealing its expressive power. A simple example-types of cars in a business system-is used for illustration. An implementation model of car types is looked at and found wanting-it does not reflect the real world properly. A clearer understanding of car types is built up by going back to fundamentals and examining our concept of a type of object the class object. This is done firstly by a brief look at the nature of the object revoluti<;m, then by contrasting the pre-object ab straction paradigm for concepts with the object-oriented paradigm's "objectification" approach-and comparing both of these with one derived from object-oriented programming (OOP). This clearer understanding of class objects is then applied to the car types example, giving a simple picture of what car types ( and ob jects like car types) are in the real world. Hopefully this illustrates the value of using an 0-0 approach to modelling the real world. USER-DEFINED TYPES Let's consider our particular example. We are familiar with user defined types such as account, invoice, and deal types. Without them users would not have the option of setting up their own types; they would have to use the ones hard-coded into the system. The use of these type objects is commonplace in business systems, whether 0-0 or traditional; almost every system of a reasonable size has a number of them. System builders are so familiar with them that often they can-with little or no analysis-intuitively work out how to implement the type objects required. The ease and familiarity of the implementation of type objects means that obvious, but awkward, questions that would arise during real-world modelling do not get asked such as: what are type objects and what do they model in the real world? An object-oriented approach enables us to give useful and interesting answers to these questions. Car types Let's look at a simple example of a system with user-defined types: car types. Let's say that in our system there are cars and car types. Cars can be saloon cars* (i.e. the class Cars has a subclass Saloon Cars). Car types can be saloon car types (i.e., the class Car Types has a subclass Saloon Car Types). Each car has to be of a particular type (i.e., each instance of the class"Cars is a type of an instance of the class Car Types; with each instance of the class Saloon Cars re stricted to being a type of an instance of the class Saloon Car Types). There is one type of car already set up in the system (i.e., there is one instance of the class Saloon Car Types)-Premier. There are two saloon cars set up in the system (i.e., instances of the class Sa loon Car)-Car# 123 arid Car# 456, both of which are Premiers. This is diagrammed in Figure 1. The type structure in this model should be familiar to most system builders. Now, ask the obvious but awkward question: what does the model tell us about what car types are and what they refer to in the real world? Not a lot; this is because it is an implementation model-i.e., a model of how the system is to be implemented-and so reflects the computer system, not the real world. The model is not the result of describing the real world (the first stage in the system building process), but a description of the system to be implemented. If we are going to follow the con- • "Saloon car" is British English for sedan car. NOVEMBER-DECEMBER 1994 39 -- 3 of 9 -- -- 4 of 9 -- -- 5 of 9 -- Modelling the real world general idea of coloured. I now have a hierarchy of abstractness (shown in Fig. 4). Let's consider conceptual structure. The diagram in Figure 5 (called a meta object schema) shows the underlying conceptual structure of abstraction. Notice that the two relations "abstracted from" and "more abstract than" are both created by the process of abstraction. We will compare this with the meta object schemas of the other conceptual structures. Issues. This abstraction paradigm is at heart psychological. Con sidering the psychological problems inherent in the paradigm gives us an insight into how it works.t In Locke's time, psychology had not evolved from philosophy and it was not standard practice to ver ify philosophy by experiment. While the paradigm may give a plau iible account of how a person uses general ideas, there is little ex perimental data to verify it. You can see this by doing an experiment; go through the red shape example observing yourself. Are you aware of yourself mak ing the idea of a shape in your mind or abstracting the colour of a shape? Do you recognise the new shape by abstracting the partic ular idea and comparing it with some general abstract idea? While your lack of awareness of the abstraction mechanism does not prove it does not exist-it may be working at an unconscious level-it also does not prove it exists. Abstraction is not the only way to acquire general concepts; we can acquire a general idea without encountering particular examples. For instance, botanists often learn about a species of flower from illus trations and descriptions before encountering an example. In these cir cumstances there must be something other than abstraction at work. The paradigm is also representational; it assumes that ideas are some sort of picture of what is being represented. We often talk in a representational way, saying things such as "I have a picture of it in my mind." The red triangle and circle icons in Figure 2 are also rep- ,resentational; they have a similar look to the things to which they refer. The impulse to link ideas to the real world by some relation of similar appearance is a good one, but unfortunately it does not work. There are severe limitations, particularly for more "abstract" gen eral ideas. Locke was aware of this: he offers this example; For example, does it not require some pains and skill to form the general idea of a triangle, (which is yet none of the most abstract, comprehensive, and difficult) for it must be neither Oblique, nor Rectangle, neither Equilateral, Equicrural, nor Scalenon; but all and none of these at once. In effect it is something imperfect, that cannot exist; an Idea wherein some parts of several different and in consistent Ideas are put together.3 We can see the same problem in the awkward representation of abstract redness in Figure 2: the general idea of redness has no shape or size, but the icon representing it has a definite shape and a definite size. It is not only a problem forming a representational general idea, but, once formed, often the idea cannot refer to any thing in the real world, because there is nothing in the real world that can be similar in appearance. For instance, the general idea t Peter Geach in his book MENTAL ACTS (1957) provides a detailed criticism of the psychological aspects of abstractionism. .../�ore ,/ abstract � than � Figure 4. Abstraction hierarchy schema of "coloured." MENTAL GENERAL IDEA more abstract than PARTICULAR IDEA refers to . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ... . . PHYSICAL PHYSICAL OBJECT Figure 5. Meta object schema of abstraction. of redness would have to refer to something in the real world with no size or shape-clearly an impossibility. Our real concern is not with the psychological problems de scribed above. Psychology studies the.working of the human mind-which we can consider as an impl�mented system, albeit im plemented in biological technology. Abstraction, if it does exist, is a feature of human thought; it is not meant to and obviously does not apply to computer system processing. Our interest here is in the general characteristics of systems, not one particular type of system; our interest is in what a system does, rather than in how a partic ular implementation does it. These are logical questions. The particular logical question that concerns us is how ideas relate (i.e. refer) to the real world. An idea or concept of an individual physical object refers to that object; this is not problematical, the relation is shown in Figure 5. But to what does a general idea refer? Under an abstractionist paradigm it does not re fer at all, it is a mental entity, part of a mechanism that we use to recog nise properties of things. It is quite clear from the meta object schema (Fig. 5) that for an abstractionist a general (mental) idea is not di rectly related to anything in the real world; it does not refer to anything in the real world. So this paradigm does not address our question at all Objectification. As with abstractionism, it is useful to put ob jectification into its historical context and describe how it works, before giving examples. By Frege's time (the late 19th century), psy chology had evolved out of philosophy into a separate discipline, but the philosophy ofconcepts, information science, was still rooted in ab stractionist psychology. Frege saw the problems, both psychological 42 JOOP -- 6 of 9 -- -- 7 of 9 -- -- 8 of 9 -- -- 9 of 9 --
BORO Research
Modelling the real world:
Are classes abstractions or objects?
31 October 1994Published in Journal of Object-Oriented Programming, Vol. 7, No. 7, pp. 39-45, 1994
Overview
The system building process should start with a model of the relevant part of the real world, but most O-O systems work is concerned with the later stages, taking O-O languages as a given and looking at how to use them to build the system. This article discusses the origin of the object paradigm, and demonstrates the value of beginning with real-world modeling using an O-O approach.
