are object-oriented programming and programming with Microsoft Visual Basic, which is not considered to be an object- oriented programming language。 This paper suggests that a full- featured object-oriented programming language is not needed to take advantage of many object-oriented concepts。 To explore this supposition, one of the authors developed an application in Visual Basic using as many object-oriented concepts as possible。 This paper describes that project and the observed capabilities and limitations of Visual Basic with respect to object-oriented programming。 Included are a set of 22 programming guidelines for object-oriented programming with Visual Basic。82243
I。 Introduction
Microsoft claims that Visual Basic is the quickest and easiest way to create applications for Microsoft Windows [Microsoft 92]。 Microsoft Windows is one of the fastest selling software packages in history: 3,000,000 copies were sold in the first nine months [Norton 92)。 Shared Medical Systems Corporation, the market leader in health care information systems, is beginning to use Visual Basic for windows programming。 Our decision to use Visual Basic is based on the belief that it is the best product on the market for developing user interfaces。
Object-oriented programming is also a rapidly developing trend in the software industry。 Object-oriented programming languages such as C++ and Smalltalk are growing in popularity。 Although object-oriented programming is no silver bullet [Brooks 87], we believe it is an improvement over the traditional procedural paradigm。 This is particularly true for real-time and windows programming。
Visual Basic is based on simplicity。 Programmers use a few fundamental types of objects to build an application。 Pure object-oriented programming takes a more sophisticated approach。 Programmers use classes, inheritance, and polymorphism to optimize reuse and represent the relationships of real world abstractions。 We believe that there are many applications for which a full-featured object-oriented programming language is not needed to take advantage of object- oriented concepts。 To explore this supposition, one of the authors developed an application in Visual Basic using as many object-oriented concepts as possible。 This paper describes that
project, the observed capabilities and limitations of Visual Basic with respect to object-oriented programming and culminates with a set of programming guidelines for object-oriented programming with Visual Basic。
II。 What is Visual Basic
Microsoft Visual Basic is designed for graphical user interface (GUI) programming。 It is not a general purpose programming language。 For example, you would not want to write a compiler in Visual Basic。 11 is not a procedural language。 Microsoft calls Visual Basic an event-driven programming language [Microsoft 92]。 Since the sequence of events that a user chooses is practically unlimited, the programmer must code each event independently in such a way that it can interact with other events。 Event-driven programming is ideally suited for object- oriented programming techniques [Nonon 92]。
Visual Basic Objects: Visual Basic objects have properties, methods, and events。 Properties define the identity and state of an object。 Methods and events define the behavior of an object。 Microsoft defines properties, methods, and events as follows:
1。Property: A named attribute of an object。 Properties define object characteristics, such as size, color, screen location, or whether the object is enabled。 Every Visual Basic object has a property called name。
2。Event: An action recognized by an object, such as clicl:ing the mouse or pressing a key。 You can write code to respond to events。 Events can occur as a result of a user or program action, or they can be triggered by the system。
3。 Method: A Subroutine or Function that operates on an object。