Introduction

Computer programmers, not so long ago, were expected to master the development of medium to large batch programs using structured programming. Newer applications require distributed interactive programs with graphical user interfaces. Fortunately, a number of techniques, tools and libraries have been developed to alleviate the increased complexity of these applications.

Graphical user interfaces benefit from libraries of reusable components such as buttons and menus, and tools that let the programmer visually position the elements composing the interface. The object oriented programming paradigm helps designing user interfaces because of the commonality between all the graphical elements involved, such as menus, buttons, type-in boxes, editors... The Smalltalk environment contains these elements and was highly successful in the area of user interface prototyping.

Distributed programming is often implemented using a layered approach. Ultimately, the programmer should not see much difference between interacting with local procedures and objects, and remote ones. Techniques such as Remote Procedure Call (RPC) and more recently Remote Method Call, or Network Objects, have simplified significantly the development of distributed applications. Of course, there is more to distributed programming. Indeed, when some of the remote objects or programs become unavailable (because of failures or simply unexpected communication delays), the difference between local and remote objects suddenly reappears.

A program receiving requests from several sources must somehow ensure that they each get a fair share of its attention. Similarly, a user interface should ideally be continually responsive to the user. However, some operations may require a long time to terminate. To remain responsive, any long operation must be interruptible. This can be achieved with the painful cooperation of long operations which must regularly stop and let other operations proceed. The alternative is to have multiple threads of execution that are preemptively scheduled such that they each get a fair share of the processing time.

None of these tools and techniques make the software development process automatic and effortless. However, together, along with the classical tools for modular design, documentation, module dependency analysis, debugging and test coverage, they can help shorten the time required to develop robust and maintainable distributed interactive applications.

There are several ways to implement these concepts. Several hundred computer languages have been developed over the years and offer the basic capabilities required for programming. Even the good old vi editor on Unix platforms has been shown Turing Complete, meaning that any program could be replaced by an equivalent file containing only vi macros.

The environment selected for this book had to support modular programming, safety and simplicity, object oriented programming, graphical user interfaces, multiple threads of execution and network objects. Furthermore, the reader could not be expected to buy an expensive development environment just to perform the exercises suggested in this book. All these criterions fortunately shortened considerably the list of suitable languages. One clearly stood apart and was selected: Modula-3.

The reality of current software development practices must not be ignored however. The important concepts are presented using a clean and powerful language such as Modula-3. Then, widespread languages such as C++ may be used when required. While the readers will probably not have C++ implementations that support multiple execution threads and automatic memory management, they will be ready when this functionality becomes available. Similarly, being used a clean language, they may maintain good design practices even when using a language which does not enforce any.

Of course, spending less time learning C++ is not as good for acquiring good reflexes for debugging C binaries corrupted by unsafe operations such as dangling pointers. With the current software development backlog however, one may hope that future software development practices will quickly evolve towards safer environments and will relegate pointer chasing to folklore.


Copyright 1995 Michel Dagenais, dagenais@vlsi.polymtl.ca, Wed Mar 8 14:41:03 EST 1995