Systematic concurrent object-oriented programming
Bertrand Meyer · Communications of the ACM · 1993
SYSTEMATIC CONCURRENT OBJECT-ORIENTED PROGRAMMINGudging by the looks of the two parties, the marriage between concurrent computation and object-oriented programming-a union much desired by practitioners in such fields as telecommunications, highperformance computing, banking and operating systems--appears easy enough to arrange.This appearance, however, is deceptive: the problem is a hard one.This article points the way toward a pos,;ible solution.The precise problem examined here is restricted to: What is the simplest, smallest and most convincing extension to the method of systematic object-oriented software construction that can address the needs oJ concurrent and distributed computing as well as those of sequential computation?The article does not claim to discuss concurrency and distribution in a general and unbiased way.Rather, it takes the object-oriented paradigm as a given (on the basis of its contributions to the production of quality software) and investigates how best to adapt it so it covers both concurrent and sequentia;[ applications.The word "systematic" as used in the title of the article will provide strong gqaidance to our search for this minimal extension.We are interested in an approach that makes it possible to reason about software systems in a precise way, by extending to the concurrent case the systematic techniques, known as 'design by contract', which can be applied to the systematic (~dthough not necessarily fully formal) development of sequential object-oriented software.A word ofwaming as to the actual ambition of the model discussed here.No claim is made that the work as reported is final, and a number of possible criticisms are discussed in the final section.I do think, however, that in its discussion of how the mutual attraction between object orientation and concurrency can be turned into a reasonably happy marriage, this article raises a number of questions.Although crucial for both COMMUNICATIONS OP THII ACM September 1993/'VoL36, No.9 ~l/ text, will describe bounded buffers.Following is a sketch of the class, with the implementation details omitted.Preconditions are introduced by require, postconditions by ensure.class BOUNDED_QUEUE[G] feature empty: BOOLEAN is --Is rhere no accessible element?do Result: = ... end; full: BOOLEAN is --Is there no room left --for more elements?do Result: = ... end; put (x:G) is --Add x as newest element.