Task-Centered User Interface Design
A Practical Introduction
by Clayton Lewis and John Rieman
Copyright ©1993, 1994: Please see the "shareware notice" at the front of the book.
Contents | Foreword | ProcessUsers&Tasks | Design | Inspections | User-testing | Tools | Documentation |

6.1 Concepts
        6.1.1 Object-Oriented Programming
        6.1.2 Event-Driven Programs
        6.1.3 Resources
        6.1.4 Interapplication Communication
6.2 OSF/Motif in X-Windows -- Toolboxes in the Trenches
6.3 Rapid Prototyping in HyperCard
6.4 Windows, the Shared-Code Approach, and Visual Basic


6.1.1 Object-Oriented Programming


Object-oriented programming is a technique for making programs easier to write, easier to maintain, and more robust. The OBJECTS of object-oriented programming are blocks of code, not necessarily on-screen objects, although the on-screen objects usually are implemented with program objects. The program objects have several important characteristics: They are defined hierarchically, with each object being an INSTANCE of a CLASS of similar objects. (A class is also defined in a single block of code.) For example, the blocks of code describing the File menu and the Edit menu would be two instances of the class of menus, and that class could itself be a SUBCLASS of the class of labels. Objects INHERIT the behavior and characteristics defined higher in the hierarchy, unless that inheritance is specifically overridden by the object's code. Inheritance would allow the programmer to change the font of all the menu objects by making a single change to the class definition. Each object also has PRIVATE DATA that defines its own characteristics and maintains information about its current state. Objects communicate with each other by sending MESSAGES. An object's response to a message is part of the behavior that the object inherits or can override.


Object-oriented programming requires an object-oriented programming language, such as C++ or CLOS, that supports the object features in addition to the basic functionality provided by most modern languages. There are differences between object-oriented languages, and not all of them support all of the features described in the previous paragraph. But they do all provide a programming structure that's an excellent match to the needs of user-interface programming. If you need another menu, you just create another instance of the menu class -- a single line of code. Then you fill in the details unique to that menu: what are the names of the menu items, where is it located on the screen, and what messages should each item send when it is selected. Additional code objects implement the functions of the program: sorting, searching, whatever. These code objects, sometimes called HANDLERS, are invoked by messages sent from menu items and other user controls, as well as from other code objects. If you need to modify the program's behavior, the class hierarchies let you make sweeping changes consistently and easily, while the private data allows you to change the behavior of an individual object without fear of unexpected side-effects.




Copyright © 1993,1994 Lewis & Rieman
Contents | Foreword | ProcessUsers&Tasks | Design | Inspections | User-testing | Tools | Documentation |