Persistence: According to Booch, persistence is the property of an object through which its existence transcends time, i。e。 , the object continues to exist after its creator ceases to exist, and/or transcends space, i。e。, the object’s location moves from the address space in which it was created (Booch 94] 。 Persistence can range anywhere from the time it takes to execute a single instruction to data that outlives the life of the program that created it [Atkinson 83)。
Visual Basic is comparable to the true OOP languages in this regard。 Procedure variables may be defined as static to keep them from being destroyed when the procedure is finished。 It does not have any special database capabilities that allow an object to outlive the program that created it, but an object’s properties can be written to disk。
Summation: Visual Basic provides three of the four major elements of the object model, namely abstraction, encapsulation, and modularity。 It also provides partial support for the minor elements of typing, concurrency, and persistence。 However, it does not support the major element of hierarchy, i。e。 , inheritance。 Therefore, in Wegner’s oft-cited classification of the degrees of object-orientedness of languages, Visual Basic would fall into the category of object-based [Wegner 87] 。
It is possible that for many applications the lack of support for inheritance will help, rather than hinder, system development。 Inheritance is probably the most difficult of the four major elements of the object model to master。 Since Visual Basic does not support inheritance, programmers are relieved of the additional conceptual overhead of learning and attempting to apply inheritance mechanisms。 Additionally, defining objects in a hierarchy increases the coupling between them which can lead to problems with program understandability。 We believe that for small to medium sized systems, consisting of a small number of abstractions, that the lack of support for inheritance will not present a significant barrier to Visual Basic programmers who wish to use object-oriented approaches。
IV。 Absence Tracking System
To examine the assertion that programmers can practice object- based programming with Visual Basic, one of the authors developed an application called the Absence Tracking System using as many object—oriented programming concepts as possible。 The Absence Tracking System is now being evaluated for use by Shared Medical Systems Corporation as a means to schedule and track employee absences。论文网
Functionality: The Absence Tracking System provides a way to schedule and record absences of employees from work。 To schedule an absence, the user selects the absence type (sick, vacation, etc。) and the number of hours from combo boxes and clicks the appropriate date。 To unschedule an absence, the user simply clicks the date again。 The user’s name and the current month default。
There are two forms for scheduling an absence。 The Two- month form shows two months at a time。 Each day of the month is a command button。 The Year-at-a-glance form shows the entire year as a spread sheet。 Processing works the same way on both forms。 A third view shows who is absent on a given date。
An options menu can be selected to customize the system for each user。 For example, the total time taken and total time remaining for the selected absence type displays on the status bar。 The time can be displayed as days or hours。 Other options include maximum hours per day, a "works weekends” toggle, and a "save settings on exit" toggle。
摘要:在如今的软件工业当中,有两个普遍的趋势,分别是面向对象的编程和带有微软定制的可视 化编程软件的编程,后一种并不被认为是一种面向对象的程序语言。这篇文章表明,一个功能全面 的面向对象的编程语言并不需要利用许多面向对象的概念。为了探究这项假设,文章的作者之一开 发了一项应用程序,那就是在 Visual Basic 中使用尽可能多的面向对象的概念。这篇文章描述了工程 和观察能力,还有带有对面向对象的程序编制的敬意的 Visual Basic 语言的局限性。一组为了带有 Visual Basic 的面向对象的程序的 22 则程序编制指导方针包括在内。