Communication-Oriented Program Architecture Alan Sobel University of Colorado Boulder, Colorado sobel@rtt.colorado.edu There has been much work on object-oriented architectures for programs but current practice of actually programming with those objects in a distributed, mobile world could benefit from more attention to the communication aspects of program arrchitecture. 'Communication aspects' refers to the organization and coordination of a program composed of interacting, distributed, mobile objects. The benefits of such attention include a generalized program archi- tecture, eliminating hidden assumptions about object location and other properties, generalizing program elements that are now uniquely distinguished, making implicit communication explicit and giving the program a greater degree of control of communication activities. Java is used as an example of current practice. A Java program is composed of one or more class definitions along with optional, free-standing (i.e., not included in a class definition) 'imports' statements. The 'imports' statements are file- (not object-) based constructs and, moreover, vestiges of a view of programs as a sequence of text rather than a collection of objects. Including an 'imports' construct as part of a class interface definition (in the manner of the 'throws' construct) would eliminate file and text notions, promote encapsulation and unify the program architecture. In addition, 'imports' statements mask the asssumptions that the imported classes reside on the current host machine and are linked in at compile-time. In a distributed environment, these two assumptions need not neces- sarily be the case. In Java there is a distinguished element of the programming environment called 'the system.' The system has a special relationship with Java programs. It provides certain essential services (such as initiating program execution) if the program provides certain method definitions. In the case of an application this is the 'main' method. For an applet, these methods include 'init,' 'start' and 'stop.' But a program need not be restricted to being controlled by only a single entity. There may be one or more 'controller' programs in the distributed environment that may exercise control over a given program. In addition to restrict- ing generality, the idea of a distinguished 'system' also hides the assumptions that the controlling program resides on the current host machine and communicates with the executing program in a synchronous manner. In Java, communication activity is typically distributed throughout the program. There is typically no central control of communication activ- ities. Each frame may have its own event loop, each thread may be doing its own I/O. In many cases this may be the ideal situation. But in other cases explicit language constructs for a greater degree of overall coordination may be required. Current object-oriented programming practice in a distributed environ- ment, as exhibited by the Java language, can benefit by explicitly as- suming an environment in which objects are distributed, mobile and in- teract and communicate in various ways with each other. Making explicit previously hidden assumptions about object locations, communication styles, functions and other properties will result in program archi- tectures that are cleaner, more general and more functional. --------------------- end ---------------------