Using an object-oriented approach to the development of a relational database application system

Download Using an object-oriented approach to the development of a relational database application system

Post on 21-Jun-2016

217 views

Category:

Documents

2 download

TRANSCRIPT

<ul><li><p>ELSEVIER Information &amp; Management 29 (1995) 107-121 </p><p>Techniques </p><p>Using an object-oriented approach to the development of a relational database application system </p><p>Pi-Sheng Deng a,*, Cynthia L. Fuhr b a Department of Computer Information Systems, School of Business Administration, California State University at Stanislaus, Turlock, CA </p><p>95380, USA b Department oflnforraation Systems, Yosemite Community College District, Modesto, CA 95352, USA </p><p>Abstract </p><p>Object-oriented technology has been proposed in recent years as a promising approach to increasing programmer productivity and the quality of software development. The traditional development of a database application system distinctively separates a system's behavior and its data by using entity-relationship diagrams, functional decomposition, and process-dependency diagrams. The object-oriented approach, on the other hand, integrates both data and behavior, and this can result in a merging of both software and databases. To gain more insight into the object-oriented approach to the analysis and design of software development, we applied this approach to the development of a simplified hospital administration system. The resulting application system is an object-based system but uses a relational database manager. This illustrates the fact that object-oriented approaches are not limited to object-oriented systems or databases: they can, in fact, be used for more traditional design. This technique may allow easier transition from data-based to object-based systems. Software that is reusable, improved in its design, more reliable, and simpler in its programming and maintenance requirements would truly be an advantage to users and developers alike. </p><p>Keywords: Classes; Messages; Objects; Object-based database systems; Object-oriented analysis and design; Object-oriented technology; Signatures </p><p>1. Introduction </p><p>Computer industry analysts have been stating for many years that we have a "software crisis." As computers are becoming faster, cheaper, and more powerful, software develoPment has become more costly and time-consuming. In fact, studies have shown that up to 95% of all software development projects are never completed without some major reconstruction or redesign. </p><p>* Corresponding author </p><p>The problem lies in the approach to software development. Traditional structured analysis and de- sign techniques leading towards modular top-down programming is very time-consuming and often can- not allow even simple modifications to a module without a complete redesign of the system. Although CASE tools were once acclaimed to solve the soft- ware problem by automatically generating programs, they still require a lengthy design process and are relatively fragile in use. </p><p>One approach that is growing in popularity and which may solve this problem is object-oriented programming (OOP) [10,17]. The premise of object- </p><p>0378-7206/95/$09.50 1995 Elsevier Science B.V. All fights reserved SSDI 0378-7206(95)00020-8 </p></li><li><p>108 P.-S. Deng, C.L. Fuhr / Information &amp; Management 29 (1995) 107-121 </p><p>orientation is that it can model the real world. Pro- grammers can organize entities through objects using encapsulation, classification and messaging. This al- lows end users to access a more user-friendly system with graphical user interfaces and more understand- able designs. Other advantages are: 1. Reusability. Classes can be put into libraries and </p><p>parts reused later in other systems. 2. Productivity. It is "natural" to solve problems in </p><p>object form rather than in low-level detail. Com- plex objects can be built simpler, in building blocks consisting of simple objects. Also, the design phase could be made faster by using ready-made classes and case tools. Changes are easier. </p><p>3. Reliability. One class used in several areas is likely to reduce the total number of bugs. </p><p>4. Easier programming and maintenance. Coding is at a high-level, using a building blocks method. Classes are independent of each other and changes do not upset other independent objects. </p><p>5. Communications. The object-orientation way of thinking promotes better communications be- tween business people and their Information Sys- tems staff. The application developer should have an easier </p><p>job as well. An increase in productivity will result when code can be reused, because models of the real world will not have to be "reinvented" for each project [1]. Programming should be at a higher level (building blocks method) and easier to accomplish [7]. Changes can be made in the implementation cycle so that most of the earlier design can be retained. </p><p>Object-orientation is not a new concept. Object- oriented programming began in the 1960's with the SIMULA language, followed by SMALLTALK, and hybrid languages, such as C + and ADA. Since then, analysis and design methods have been devel- oped to aid the modeling of data-oriented systems. There are over 100 object-based and object-oriented languages available today [3]. </p><p>An object-based language directly supports data abstraction and classes, while an object-oriented lan- guage is object-based and supports inheritance. Pure languages have been built to be object-oriented and only accept objects, methods, and classes. Hybrid languages are non-object-oriented, accepting other </p><p>data types than objects, but also allowing objects, classes, and methods. A disadvantage to this type of language is that it tends to lead the programmer back to a traditional approach [5]. </p><p>In terms of database technology, there seems to be an on-going controversy over object-oriented ver- sus relational approaches [2,9,11,16]. One solution has been to merge the technologies, allowing object- based routines in SQL databases [13]. </p><p>In order to gain more insight into the object-ori- ented technology, we apply the approach to the analysis and design of a relational database applica- tion system. MicroSoft's Visual Basic 3.0 standard edition was used in implementing the research. </p><p>2. Principles of object-oriented technology </p><p>The object-oriented approach to information sys- tem development is built upon three basic ideas: objects, messages, and classes. An object is a soft- ware entity with behavior (or a collection of proce- dures) and data. It is autonomous, in the sense that it can satisfy requests sent from other objects without a need for any external step-by-step instruction. This is attained through the set of procedures (called meth- ods) embedded in the object. Such self-sufficiency renders objects ideal software modules, and their maintenance can be accomplished independently. </p><p>Objects communicate by sending messages, and objects respond by carrying out their own methods. A message for an object mainly consists of the name of the object and the name of a method that the object can execute. Message passing is the necessary means to activate objects, and objects respond only to messages. </p><p>Since objects communicate through message pass- ing, an object cannot directly access another object's variables. This provides a form of encapsulation, protecting an object's variables from being corrupted by other objects; this also simplifies the interactions between objects. In addition, the same message can be used to obtain different results by sending it to different objects. This hiding alternative procedures behind a common interface is called polymorphism. One of its key benefits is that it helps keep the number of names for different tasks or operations to a minimum. This also simplifies the programming </p></li><li><p>P.-S. Deng, C.L. Fuhr / lnformation &amp; Management 29 (1995) 107-121 109 </p><p>process and improves the readability of the program. As a consequence, modification and maintenance are also simplified. </p><p>The object oriented approach uses the concept of classes: similar objects are grouped together. The objects belonging to the same class are called in- stances of that class. A class serves as a template (or definition) for the common methods and variables shared by its objects; the actual values for the vari- ables or the parameters used in the methods are contained in the object instance. </p><p>Actually, a class is a generalization of its objects. Thus, classes can be grouped into superclasses to form different levels of generalization. In this class hierarchy, a lower level class can inherit methods and variables from its superclass, but still establishes its own special characteristics by adding to the inher- ited behavior. When an object receives a message to carry out a method that has not been defined in its class, the object searches up its class hierarchy until it finds the definition of that method and then applies it to its own local data values. </p><p>Another characteristic of the class hierarchy is its ability to accommodate exceptions. In the class hier- archy, exceptions defined at a lower level always </p><p>override the more general methods defined at a higher level. With overriding, special cases can be handled efficiently and easily. </p><p>3. Object-oriented approach </p><p>3.1. Object-oriented analysis </p><p>Although a traditional structured analysis ap- proach can still be used, other views have surfaced to handle object oriented (OO) analysis. In object-ori- ented analysis, the behavior and data of the system are treated as integrated objects using a variety of techniques [8]: there is still no current standard ap- proach. </p><p>Martin [15] uses object structure and object be- havior analysis for building the model. The main purpose of the analysis is to identify object types and their associations; then their relations to other ob- jects, as well as their purpose and role, are also defined. In OO analysis, the primary focus is in finding out what happens to the objects over time: state transitions -the states that the objects can take and the events that cause the change and the result- </p><p>Inventory Item </p><p>General Ledger Bill </p><p>Service Physician Employee Item </p><p>Cost Center </p><p>Patient Party i </p><p>I </p><p>Fig. 1. Enterprise model of the patient care administrative system. </p></li><li><p>110 P.-S. Deng, C.L. Fuhr ~Information &amp; Management 29 (1995) 107-121 </p><p>Table 1 Candidate classes after elimination of redundant classes. </p><p>Patient Name Treatment Patient Bill Patient Service Expected Date Discharged Room Accommodations Patient SSN Main Menu Patient Information Display Room Utilization Display Phone (Contact Info) Patient Home Phone Room Location </p><p>Physician Name Patient Record (Patient) Insurer Service Charge Date Discharged Patient Address (Contact Info) Room Identification (Location) Physician Phone Ext. Patient Bill Display Services Display Patient Procedure (Treatment) Patient Charge </p><p>Room (Location) Physician Identification Patient Balance Date Admitted Physician Specialty Patient Identification Room Phone Ext. Third Party (Insurer) Patient Treat. Display Physician Info Display Service Identification Patient Contact Info </p><p>ing outputs. Object-flow diagrams, event schemata, operation diagrams, object states, and trigger rules are used to do this. </p><p>According to Jacobson et al. [12], during the analysis phase we must identify objects, organize them, describe how they interact, define the opera- tions of them, and define their internal aspects. The model captures the information, behavior, and pre- sentation of the objects. Objects are one of three types: entity, interface or control. </p><p>The "core model," proposed by de Champeaux et al. [6], has four components. A matrix shows how objects are defined based on their static and dynamic </p><p>characteristics and behavior both inside the object and between objects. In a static dimension, objects need attributes to describe them. Constraints define the limitations of attribute value combinations. For example, a department may have the attributes direc- tor and secretary with "employee" as their value; however, a director is not a secretary, and vice versa, so a constraint could be: director ~ secretary. In the dynamic dimension, the different states and expected behavior of the object and its interactions are de- fined. </p><p>Coad and Yourdon [4] have developed a well- known approach to analysis that consists of: </p><p>Table 2 Superclasses identified during the exploratory phase. </p><p>Super Class Classes Super Class Classes </p><p>Display Main Menu Identification Patient Information Patient Billing Patient Treatment Physician Information Service Information Room Information </p><p>Phone Room Phone Ext Name Physician Phone Ext </p><p>Patient Home Phone </p><p>Charge Patient Charge Date Service Charge </p><p>Patient Identification Patient SSN Physician Identification Service Identification Location Identification </p><p>Patient Name Physician Name Insurer </p><p>Date Admitted Expected Discharge Date Discharge Date </p></li><li><p>P.-S. Deng, C.L. Fuhr / Information &amp; Management 29 (1995) 107-121 111 </p><p>1. identify objects by studying the "problem space," reading requirements, noting any nouns, and lis- tening to the users. Analyze text and pictures. </p><p>2. identify structures of the problem by class-mem- ber grouping and whole-part grouping. For exam- ple, the class vehicle could have car, truck, and motorcycle members, while a car could contain an engine, tires, steering wheel, and transmission. </p><p>3. define each structure and object limiting the num- ber of components of each so that the intended user can easily comprehend the problem. Using the "7 + 2" rule is one way of accomplishing this. </p><p>4. define attributes to add detail to the object or classification structure; e.g., the class vehicle and all its members will have VIN, model, and color attributes. </p><p>5. define services or required behavior of each ob- ject and classification structure upon receipt of a message. </p><p>3.2. Object-oriented design </p><p>In object-oriented design, a variety of techniques can be used to design a system. Several possible approaches have been proposed. </p><p>Martin's approach uses class structure and method design. The results from the object structure analysis are used to define and design classes, class methods, class hierarchies, inheritance, data structures, and databases. In method design, the primary focus is towards designing the methods of objects, based on the behavior analysis. The design of methods and operations, procedural logic, non-procedural code, </p><p>Table 3 Purpose of each class. </p><p>Class Description and Purpose of Class </p><p>Patient Name Physician Name Treatment Patient Bill Insurer Patient Balance Patient Service Service Charge Date Admitted Expected Date Discharged Date Discharged Physician Specialty Room Accommodations Patient Identification Patient SSN Physician Identification Room Phone Ext. Main Menu Patient Treatment Display Physician Phone Ext. Room Utilization Display Services Display Physician Info Display Service Identification Patient Home Phone Patient Charge Patient Contact Information Room Location Patient Information Display Patient Bill Display </p><p>First, Middle Initial, Last Name identifying patient First, Middle Initial, Last Name identifying physician Procedure physician performed on patient Patient charges for services...</p></li></ul>

Recommended

View more >