We should not underestimate the suc- cess. David Taylor wrote in “Software [R]evolution: A Roundtable” (Computer, A Really May 1999, p. 50) that “by the year 2000 no one would talk about objects any more

Component and Object Technology because the technology would be so thor- oughly absorbed into the mainstream that Good Idea no one would think to mention it.” His time frame may be premature by a few , ISE years but absorption is definitely the trend. All major developments in the software world integrate OO aspects or at least claim to do so. Almost all recent pro- gramming languages are OO in some s this is the final installment of ways; even good old Fortran, in its latest the Component and Object version, has some timid support for data Technology column, I will try abstraction. This may be what Al Davis’s to come back to the source, consulting clients really mean: We know A object-oriented development, all about objects, don’t bother us with this. and reflect on its contribution and future. But it’s a sign of success, not rejection. Wise people have at various times pre- dicted or even announced the end of IT’S THE ONLY GAME IN TOWN objects. As early as 1989 (see Scott Whatever reservations anyone may Guthery, “Are the Emperor’s New have about some or another aspect of Clothes Object-Oriented?” Dr. Dobb’s Don’t blame OO current object technology, it is still true Journal, Dec. 1989, p. 80), articles were programming in general that, as Grady Booch noted a few years appearing on the “object winter” theme, for the limitations of ago, we don’t really know any better; patterned after the “AI winter” reported those who don’t know when it comes to building complex, evo- to have followed the initial excitement how to apply the lutionary, mission-critical systems, OO over artificial intelligence. The theme has principles. solutions are our best bet. Nothing else gained new vigor in the past few months. has come to challenge them. In (July 1999, Nothing, not even component-based p. 33), a review by Alan Zeichik of development. As has been clear in this Clemens Szyperski’s Component Soft- word ‘object.’ Now, none do, and I find column, with all my enthusiasm for com- ware book states: “Whether we like it or that clients are much happier when they ponent-based development, leading in not, in most situations object-oriented don’t.” He follows this with a final blow: particular to the column’s broadening of programming has not succeeded in fos- “I think ‘object’ has now gone the way scope last year (from “Object Tech- tering code reuse, except in the most lim- of ‘structured.’” nology” to “Component and Object ited way.” The comparison with structured pro- Technology”) and to the special section Recently, IEEE Software has been the gramming is appropriate: In the case of on CBD (co-edited with Christine place of choice for death notices, with structured programming, too, a set of Mingins, in last July’s issue of Com- such pronouncements by former editor- simple but profound conceptual princi- puter), I find absurd the claim that (in in-chief Al Davis as “We are all now wit- ples enjoyed partial success, a passage of Alan Zeichik’s phrase) “objects are tired, nessing the fall of the Object era” some of the ideas into the fabric of daily components are wired.” Components, to (“Predictions and Farewell,” July/Aug. software development to the point of misquote Clausewitz, are just the pursuit 1998, pp. 6-9). In his final interview (“A becoming so obvious that many practi- of objects through other means. Com- Golden Thread in Software’s Tapestry,” tioners do not realize that the ideas were ponents assume object technology, they Nov./Dec. 1998, pp. 18-21) he says, once new and controversial; in addition use object technology, and they promote “When I started consulting ten years ago, to this success, these conceptual princi- object technology. all my customers wanted to hear the ples suffered a form of degradation, com- Every one of the currently prominent ing in part from the transfer of the name CBD approaches is directly rooted in Editor: Bertrand Meyer, Interactive “structured” to denote mere graphical objects, be it CORBA, Enterprise Java- Software Engineering, ISE Bldg., 2nd Fl., conventions for describing system struc- Beans, or COM with its direct reliance 270 Storke Rd., Goleta, CA 93117; voice tures, useful in themselves but a far cry on the Vtables of C++. (805) 685-6869; [email protected] from the intellectual discipline of the One can understand the buzz-of-the- original ideas. year phenomenon, if only as a way for

144 Computer consultants to renew their claims to exper- of object technology, and, more gener- anyone chosen 02 as a pivot?) will be the tise. We in the software field don’t have ally, many of the principles of modern opportunity for a mini-Y2K. preseason sales and postseason discounts, programming methodology. There is no excuse for such nonsense. so we need ever new ways to drum up It passes on to our successors the same business. There’s nothing wrong with that; THE NEXT 99 SOFTWARE DISASTERS calamity that our predecessors (in some let’s just not take it too seriously. Perhaps the most striking example of cases ourselves) inflicted on us. But they David Taylor, in the roundtable cited what we still have to learn is the success at least had the excuse that it was the first above, noted that “Even Object Magazine of the so-called windowing Y2K tech- time, that no one knew, and that we were changed its name to Component Software nique. I don’t have any actual , all learning. This time there is no such to maintain its cutting edge.” That was but informal inquiries suggest it’s one of excuse; we should know better. quite amusing, since a couple of months the most commonly used “solutions” to after Taylor’s article Component Software LESSON NOT HEEDED? announced that it was merging with The Y2K mess as a whole is evidence Application Development, retaining the While many engineers that, for all the talk about objects having latter’s title. Does this mean that compo- and managers are familiar become mainstream, we still have a long nents are out and we are now back to with the basic goals of way to go, and not only regarding the applications? Probably not. A marketing object technology, only more advanced parts of object technology. strategy is not a technology trend. a minority has really In this department’s column about the understood the deeper topic (Christopher Creele, Bertrand TEACHING THOSE concepts and started to Meyer, and Philippe Stephan, “The Op- WHO ALREADY KNOW apply them thoroughly. portunity of a Millennium,” Computer, The “we know all about objects so Nov. 1997, pp. 137-138), we pointed out what else is new” attitude cited by Al that the millennium problem was the Davis is indeed widespread. In my expe- the Y2K issue. Windowing means that opportunity for a generalized opening-up rience it is largely unjustified. While you don’t touch files and using and cleaning-up of major software sys- many engineers and managers are famil- two-digit dates; you just choose a pivot tems. All signs indicate that this has hap- iar with the basic goals of object tech- date, say 1960, and hack the programs pened only in a minority of enlightened nology, only a minority has really so that whenever they use a 2-digit date companies. Others have simply patched understood the deeper concepts and code xy they do something like their code and are hoping for the best started to apply them thoroughly. This (including hoping that the patching can make life tough for object technol- if xy < 60 then process will not have introduced too ogy consultants and instructors: As every Understand this as the many new bugs). For all these companies, parent and educator knows, it is impos- date 20xy object technology is still in the future. sible to teach people something when else What object technology? This is where they think they already know it. Understand this as the we must again take a serious look at the I find that general intellectual sympa- date 19xy supposed arguments against object tech- thy with the principles of information end nology. (You can find a set of links in the hiding, data abstraction, taxonomy, “pros and cons” section of the Cetus OO reuse, systematic software construc- There can be no universal pivot date, so links at http://www.cetus-links.org/oo_ tion—an attitude found fairly universally “60” is just an example. An airline’s fre- infos.html#oo_general_info_general_ today—is not a good predictor of quent flyer system doesn’t need to go articles.) Although the criticism is offi- whether the person will actually apply back any earlier than 1970, but the air- cially directed at object technology, what these principles in software development. line’s pension program may have to deal it really addresses in many cases is C++. To anyone who has the opportunity of with people born in 1910. In an early article about object technol- peeking at the way companies large and Now this is really clever. First we make ogy, Bjarne Stroustrup mocked the pseu- small routinely write software these days, the programs even more complicated dosyllogism “Ada is good; Ada is OO; the myth that object technology is now than before, with all kinds of spurious therefore OO is good.” What we have passé sounds absurd. Not that the pic- tests, not to mention the possibility of seen more recently is more “C++ is OO; ture is doom and gloom; I disagree with added bugs. Second, we have just pushed C++ is bad; therefore OO is bad.” those (often vocal in the pages of IEEE the problem further, creating potential This was very much the assumption Software) who claim that we have made Y2K-like disasters for the next 99 years: behind an indictment of objects by Les no progress at all in the past 30 years. We Since there is no universal pivot, every Hatton (“Does OO Sync with How We have better tools, better practices, a gen- system has its own time bomb, ticking Think?” IEEE Software, May/June 1998, erally more serious attitude. But most of down to its own specific self-destruction pp. 46-54), which Richard Wiener criti- the industry is far from having integrated deadline. Every year from now on (well, cized in the same issue, taking Hatton to in its daily practice the deeper principles maybe not the next two or three, or has task for equating OO and C++: “With

December 1999 145 Component and Object Technology

technology: making sure that we indeed //function to eliminate blanks from a string judge the technology—not partial, void eatspaces (char * str) { incomplete, or even flawed implementa- int i=0; /* copy to offset within string */ tions that can give the whole field a bad int j=0; /* copy from offset within string */ name. The problem is not just C++. while (( *(str + i) = *(str + j++)) != '') While recognizing the major contribu- if (*(str + i != '-') i++; tions of UML and Java, I have described return; elsewhere (http://www.eiffel.com/doc/ } manuals/technology/bmarticles/uml/ and http://www.elj.com/eiffel/bm/mistake/) some of the problems I see in both Figure 1. Removing blanks from a string in C++. Can this be called object-oriented? approaches; I have also discussed the dangers of mixing the object paradigm extreme discipline programmers can use j++ is j+1, except that evaluating this with foreign ideas (such as entity-rela- C++ as an OO language, but more often expression also increases the value of j tionship modeling or the C style of devel- than not they use it as an extended C” by one, but only afterwards, in contrast opment) that, although respectable on (“Watch Your Language,” IEEE Soft- with j++. *(str + i) = *(str + their own, clash with object technology. ware, May/June 1998, pp. 55-56). ++j) is an assignment of what comes My own work has been based on a The point here is not to start a language after = to what comes before, so it re- more systematic application of OO prin- war, especially since I am associated with places the i-th value of the string; but it ciples. Let me illustrate the contrast another OO language, Eiffel (more ap- is also an expression whose value is what through two examples, both of which I propriately characterized as a method). is being assigned, so that the whole discuss in Object-Oriented Software But it is legitimate for those of us who enclosing expression actually returns true Construction (Prentice Hall, 1997). have been pushing full-fledged object Many approaches still allow a direct technology to refuse to let that approach field assignment of the form x.field = be blamed for limitations, perceived or To anyone who has the value. This is fine in non-OO develop- real, of others whose applications of OO opportunity of peeking ment, in which you are dealing with principles is highly debatable. at the way companies structures, but is completely incompati- write software these days, ble with the OO view that we are build- IF THIS IS OO ... the myth that object ing little machines, each with its official Figure 1 is a function—from one of the technology is passé control panel (the class interface) serving most frequently used C++ introductory sounds absurd. as the obligatory path to the internals. textbooks (Ivor Horton, Beginning Direct field assignment means that users Visual C++ 6, Wrox, 1998, p. 227, com- of the machine can circumvent that inter- ments removed)—for removing blanks if and only if this newly assigned value is face and start rearranging the innards of from a string. If this is what OO devel- not equal to '' which, as every the machine directly. This is simply not opment is, then I am ready to enlist in the kindergarten student knows by now, is acceptable in modern software technol- anti-object battalion. the special character marking the end of ogy. The management solution—forcing I also start believing Hatton’s reports any well-behaved C++ string. Wow! all attribute declarations to be private— of unchanged or decreased productivity To me, this can’t have anything to do is unrealistic since it would lead to lots and reusability. But of course this kind of with object technology. That the example of useless get functions. style is the opposite of all that a serious is “in the small” doesn’t matter: The in- This brings us to the second example: object-oriented developer would do: It the-large aspects of programming rely on the Uniform Access Principle. It’s at first uses pointers and side effects throughout, the lower level parts, and you can’t get a small notational issue, but (like many mixes queries and commands (asking a them right unless you get the small things other problems related to data abstrac- question shouldn’t change the answer!), right too. The obsessive use of side-effect- tion and information hiding) can take up and shows no attempt at abstraction. A producing functions (totally unnecessary gigantic proportions if not observed Boolean expression like (( *(str + in this example) and pointer-based object properly. The principle simply states that i) = *(str + j++)) != '') is access pervades an entire software cul- if a module, the client, is accessing a an open invitation to bugs and mainte- ture that is at odds with the OO view of managed by another module, nance nightmares. quality . the supplier, it should not matter to the If you haven’t been initiated in the client whether the supplier keeps the great secrets of life, here’s what the CASES THAT GIVE property stored or computes it on expression means: str is the start of the EVERYONE A BAD NAME demand. chain. str + i is its i-th position. This may be the most serious problem So if I write my_house_loan. *(str + i) is the value at position i. of assessing the contributions of object monthly_interest I should not have

146 Computer to know whether monthly_interest ronment that’s not just OO in name, and indeed get the advertised benefits. As is an attribute, stored with every instance forces you to apply the rules. Roger Osmond put it in a TOOLS USA of the HOUSE_LOAN class, or a function, keynote a few years ago, “Object tech- computed from some formula associated he rules are not everything, but they nology brings you more than the hype with the class. The purpose is obvious: are part of the approach. Object would have you believe.” Productivity, to keep modules independent from each T technology has, in Isaiah Berlin’s extensibility, reuse, and reliability can all other’s implementation decisions and metaphor, a little of the fox and a little be achieved. But only a minority of the hence from variations in each other’s of the hedgehog: The hedgehog knows industry has tried seriously and without implementations. Yet most current one big thing; the fox knows many compromise. The experience of others— approaches force a separate notation for things. Like the fox, we must know and those who went at it half-heartedly—is field access and attribute call. (This point apply many small things: all the rules. We not a good argument to discredit the is discussed further in the January 2000 also know not one big thing but in fact a technology. Eiffel column of JOOP.) few big things, from data abstraction to So my answer to the OO critics, which will also serve as a conclusion to the THE IMPORTANCE Component and Object Technology col- OF BEING DOGMATIC When it comes to building umn, can only be the application to These comments may appear dog- complex, evolutionary, object technology of Gandhi’s retort matic. After all, one may ask, does every mission-critical systems, when he was asked for his thoughts detail matter? Do we have to apply every OO solutions are our about Western civilization: It would be a tenet of the OO canon, chapter and best bet. good idea. ❖ verse? I would tend to answer yes. It pays to be dogmatic here. It’s hard to be “a lit- tle bit object-oriented.” Little violations inheritance to Uniform Access to Com- beget huge disasters. Y2K is the most vis- mand-Query Separation to Design by ible example. Contract—the simple yet profound intel- As was pointed out in the November lectual principles that this column has (I Check us on the 1997 column, the Year 2000 “bug” is hope) occasionally been able to touch on out . . . not about the alleged stupidity of coding and which, more than anything else, eb dates on two digits—a mere implemen- define the approach. tation choice similar to countless ones Like structured programming before Each time IEEE Internet Computing that programmers make all the time. It is it, and in spite of being (like structured about information hiding, or rather the programming) subject to the phenome- magazine goes to press, an issue of lack thereof, which spread the conse- non of vulgarization and watering down IC Online also goes live to the Web. quences across millions (globally, bil- that inevitably goes with hype and suc- We’re working to become your lions) of lines of code. Like many other cess, object technology is defined by a resource for Internet technologies. OO principles, information hiding is, few seminal ideas—a dozen or two alto- fundamentally, a very simple idea. No gether—that radically change one’s view ◆ tutorials ◆ interviews ◆ rocket science required; just seriousness, of software development. And it is standards ◆ protocols professionalism, care, and thoroughness. defined, too, by the patient and obstinate ◆ resource links ◆ news ◆ Remember this the next time you feel application of little rules. ◆ the urge to use a direct field assignment Successful object technology is a mix new products industry x.field = value. You may think that of the two. We must understand the intel- ◆ reports ◆ roundtables ◆ in the case at hand there’s nothing wrong: lectual principles for all their worth, let- and lots more all the time. You know exactly what you are doing, ting them permeate our entire approach there is no possible precondition or to software development, never losing For engineering and applying Inter- invariant violation, and it’s a mere assign- sight of the bigger challenges. And we net technologies, you’ll always find ment that doesn’t have to notify any must also be foxes, never relenting in our more at . . . observers. And you may even be right— application of the rules, however ele- for the moment. mentary and mundane. But that’s not an excuse. Think of the All the evidence of my and my col- consequences of that violation, magni- leagues’ work over the past two decades, fied by the number of cases in which the reinforced by the observation of large http://computer.org/internet/ matter arises, the size of the project, its projects developed by our customers in duration, the number of people who may the most demanding mission-critical con- have to use or take over your work. And texts, is here to reinforce the view that if apply the rules. Better yet, use an envi- you do follow this strategy you will

December 1999 147