ILE- NAVAL POSTGRADUATE SCHOOL · 1 F ILE-NAVAL POSTGRADUATE SCHOOL ... feasibility of providing a visual interface to allow queries from a front end ... Attribute-Based Data Language - [PDF Document] (2024)

1 F ILE-

NAVAL POSTGRADUATE SCHOOLMonterey, California

00

NN

THESIS

GRAPHIC INTERFACE FOR ATFRIBUTE-BASEDDATA LANGUAGE QUERIES FROM A

PERSONAL COMPUTER TOA MULTI-LINGUAL, MULTI-MODEL,

MULTI-BACKEND DATABASE SYSTEM OVERAN ETHERNET NETWORK

by

William Goebel Anthony Sympson III

December 1989

Thesis Advisor: C. Thomas Wu

"- .,.Approved for public release; distribution is unlimited

: _DTICtelELECTEII

90 07 5 081

UnclassifiedSecurit Classificaion of this ale

REPORT DOCUMENTATION PAGEla Report securty Ciessification UNCLASSIFIED lb Resicte Muking2a Secuity Classification Authority 3 Distriuliton Availability of Report2b iw ng Scdw¢e Approved for public release; disuibuion is unlimited.4 Performing Organizaton Report NNumbe) 5 Moni" OriCrizetiot Report Nunber(s)6a Name of Performing Organization 6b Office Symbol 7a Name of Monitoring OrgutizationNaval Postgraduate School (if Ampicabe) 52 Naval Postgraduate School6c Address (city. stae. ad ZIP code) 1b Address (city. Aw. ad ZIP code)Monterey, CA 93943-5000 Monterey, CA 93943-5000ga Name of Funding5/poaaisng Organiza2 I Sb Office Symbol 9 Pzureinnt istrumuet Identification Number

(if Applicable)8c Address (city. state. and ZIP code) 10 Source of Pundinz Numbers

11 Title (Include Security Classfication) GRAPHIC INTERFACE FOR A-TRIBUTE-BASED DATA LANGUAGEQUERIES FROM A PERSONAL COMPUTER TO THE MULTI-LINGUAL, MULTI-MODEL, MULTI-BACKEND DATABASE SYSTEM OVER AN ETHERNET NETWORK12 Personal Author(s) Symr son III, William G. A.13a Type of Report 13b Time Covered 14 Daze of Report (year, month ay) i 15 Page CountMaster's Thesis lFrom To[ 1989 December 112816 Supplementary Notation The views expressed in this thesis are those of the author and do not reflect the officialpolicy or position of the Deartment of Defense or the U.S. Government.17 Cosati Codes 18 Subject Terms (continue on reverse if necessary and identify by block number)Field Group Subgroup object-oriented language, graphical interface, database language

4 19 Abstract (continue on reverse if necessary and identify by block number

This research is aimed at taking one step closer to the goal of the "paperless ship". This thesis examined thefeasibility of providing a visual interface to allow queries from a front end Personal Computer (PC) using theAttribute-Based Data Language (ABDL) to a Multi-lingual, Multi-model, Multi-backend mini-computer Providingan improved Human-Machine Interface for the system will greatly increase its usability. A prototype wasimplemented in the Graphics LAnguage for Database (GLAD) on a Zenith 248 as the front end connected to a ISImini-computer running the Multi-Lingual, Multi-Model, Multi-Backend Database System (MBDS), a backend ofthe future. The Zenith 248 was chosen as the front end because of the large quantity of these computersthroughout the Navy. GLAD was used because it is a graphics object-oriented environment for databases thatgives the user access to both data manipulation and program development through visual interaction. This createsa user friendly windowing environment both for development and for operational applications. Looking towardsthe future, MBDS is the perfect backend as it is the latest in Database management systems. This thesis providedan extension to GLAD to demonstrate the ability to send Attribute-Based Data Language to Multi-BackendDatabase System.

3D Distribution/Availability of Abstract 21 Abstract Security Classification- mclassified/unltiied -" same as reri [] DIC users Unclassified

22a Name of Responsible Individual 22b Telephone (Include Area code) I 22c Office SymbolProfessor C. Thomas Wu (408) 646-3391] Code 52 WqDD FORM 1473. 84 MAR 83 APR edition may be used until exhausted security classification of this page

All other editions are obsolete Unclassified

i

Approved for public release; distribution is unlimited.

Graphic Interface for Attribute-Based Data Language Queriesfrom a Personal Computer to the Multi-Lingual, Multi-Model,

Multi-Backend Database System Over an Ethernet Network

by

William Goebel Anthony Sympson IIILieutenant, United States Navy

B.S.S.E., United States Naval Academy, 1984

Submitted in partial fulfillment of the requirements for

the degree of

MASTER OF SCIENCE IN COMPUTER SCIENCE

from the

NAVAL POSTGRADUATE SCHOOLDecember 1989

Author: At~~poWilliam Goebel Anthl6ny Sympson III

Approved by: C. Tt'1fas-Wu, Thesis. Advisor

/Davi..Hiao, nd Reader

Robert B. McGhee, Chairman, Department of Computer Science

ii

(

ABSTRACT

a '! This research is aimed at taking one step closer to the goal of the 'paperless

ship. This thesis examined the feasibility of providing a visual interface to allow

queries from a front end Personal Computer (PC) using the Attribute-Based Data

Language (ABDL) to a Multi-lingual, Multi-model, Multi-backend mini-computer

Providing an improved Human-Machine Interface for the system will greatly increase its

usability. A prototype was implemented in the Graphics LAnguage for Database

(GLAD ) on a Zenith 248 as the front end connected to a ISI mini-computer running the

Multi-Lingual, Multi-Model, Multi-Backend Database System (MBDS), a backend of

the future. The Zenith 248 was chosen as the front end because of the large quantity of

these computers throughout the Navy. GLAD was used because it is a graphics

object-oriented environment for databases that gives the user access to both data

manipulation and program development through visual interaction. This creates a user

friendly windowing environment both for development and for operational applications.

Looking towards the future, MBDS is the perfect backend as it is the latest in Database

management systems. This thesis provided an extension to GLAD to demonstrate the

ability to send Attribute-Based Data Language to Multi-Backend Database System.

Aooe sion For

NTIS GRA&IDTIC TAB 0Unannounced 0it.4 s I r ,"or 0

Availability codes

Di t ISpotsj

iVaiWa sDit11OA

•m 2 It A [ I

TABLE OF CONTENTS

I. INTRODUCTION ................................................................................................. 1

A. BACKGROUND ........................................................................................... 1

B. THE NEED FOR RESEARCH ................................................................ 2

C. THESIS ORGANIZATION ....................................................................... 3

II. OBJECT-ORIENT PROGRAMMING AND THE ACTOR ENVIRONMENT .... 5

A. OBJECT-ORIENTED PROGRAMMING (OOP) ...................................... 5

1. Introduction ..................................................................................... 5

2. Fundamental concepts of Object-Oriented Language ......................... 6

a. Objects ..................................................................................... 6

b. Classes ..................................................................................... 6

c. Messages ................................................................................... 7

3. Inheritance, Polymorphism and Encapsulation ................................... 8

a. Inheritance ................................................................................. 8

b. Polymorphism ............................................................................ 9

c. Encapsulation .......................................................................... 10

4. Object-Oriented Programming Summary .......................................... 10

B. ACTOR ENVIRONMENT ......................................................................... 11

1. Microsoft W indows .............................................................................. 11

a. M S-W indows requirements ....................................................... 12

b. Sample W indow ....................................................................... 13

c. Dialog Box .............................................................................. 14

2. Actor ................................................................................................. 15

i"'

a. Actor requirements ....................................................................... 17

b. Starting Actor .......................................................................... 17

c. Workspace Window ................................................................ 17

d. Browser Window ..................................................................... 18

e. The Inspector and Debug Windows .......................................... 19

C. SUMMARY ............................................................................................. 20

II. BACKEND DATA SYSTEM AND SOCKET INTERFACE ........................... 21

A. BACKEND DATA SYSTEM .................................................................. 21

1. Database Management System DBMS ............................................. 21

a. Multi-Lingual Database System ................................................ 21

b. Multi-Model Database System ................................................ 24

c. Multi-Backend Database System .............................................. 25

2. The Data Model and Data Language ................................................ 27

a. The Attribute-Based Data Model ............................................. 27

b. The Attribute-Based Data Language ......................................... 28

B. THE SOCKET INTERFACE .................................................................. 30

1. Socket Interface between MBDS and GLAD ................................... 30

a. The MBDS Socket Interface ..................................................... 31

b. The GLAD Socket Interface .................................................... 34

IV. IMPLEMENTATION ..................................................................................... 36

A. GRAPHICS LANGUAGE FOR DATABASE ........................................ 36

1. B ackground ..................................................................................... 36

2. Hardware and Software requirements .............................................. 36

B. MODIFICATIONS ................................................................................. 38

I

V

1. Resource File ................................................................................... 38

2. DM W indow Class .......................................................................... 40

C. IM PROVEMENTS ................................................................................. 41

1. QueryW indow Class ....................................................................... 41

a. Edit ........................................................................................ 42

b. Query ...................................................................................... 43

c. Templates ................................................................................. 45

d. Describe ................................................................................. 46

e. Send Query .............................................................................. 47

f. Help ........................................................................................ 49

g. Quit ........................................................................................ 49

D. Sample Session ....................................................................................... 49

1. Starting Glad to receiving Results .................................................. 49

a. GLAD Top-Level W indow ....................................................... 50

b. Data M anipulation W indow (DM W indow) ............................... 53

c. List M ember W indow .............................................................. 54

d. Display One W indow .............................................................. 54

e. QueryW indow .......................................................................... 55

IV. CONCLUSIONS ............................................................................................ 59

A. A REVIEW OF THE RESEARCH ......................................................... 59

B. FUTURE ENHANCEM ENTS ................................................................ 59

C. DISCUSSION AND BENEFITS OF THE RESEARCH .......................... 60

APPENDIX A - Actor.RC RESOURCE CODE LISTING ...................................... 62

APPENDIX B - DMWINDOW CLASS CODE LISTING ..................................... 84

APPENDIX C -QUERYWINDOW CLASS CODE LISTING ................................. 105

vi

LIST OF REFERENCES ..............................................114

INITIAL DISTRIBUITION LIST ....................................................... 116

vii

LIST OF FIGURES

Figure 2.1 Windows layered over DOS ................................................................. 11

Figure 2.2 Sample Window .............................................................................. 13

Figure 2.3 Sample Dialog Box .......................................................................... 15

Figure 2.4 The Actor About Box ....................................................................... 16

Figure 2.5 Actor Workspace Window ................................................................ 18

Figure 2.6 The Browser Window ....................................................................... 19

Figure 3.1 The Multi-Lingual Database System ................................................ 22

Figure 3.2 Multiple Language Interface ............................................................ 23

Figure 3.3 The Mixed-Processing Strategy ...................................................... 25

Figure 3.4 The Multi-Backend Database System ............................................. 26

Figure 3.5 MBDS/GLAD Interface ................................................................... 31

Figure 4.1 Initiate QueryWindow from DMWindow ........................................ 40

Figure 4.2 QueryWindow ................................................................................. 41

Figure 4.3 QueryWindow Edit option selected .................................................. 42

Figure 4.4 Query option pop-up menu .............................................................. 43

Figure 4.5 Sample QueryWindow after the Delete option of Query selected .......... 44

Figure 4.6 The Template options of QueryWindow ........................................... 45

Figure 4.7 Template Window for Delete ........................................................... 46

Figure 4.8 The Describe option of QueryWindow ............................................. 47

Figure 4.9 The Send Query option of QueryWindow ........................................ 48

Figure 4.10 Awaiting Results from MBDS ......................................................... 48

Figure 4.11 The Results displayed in the Browse Window ................................. 49

Figure 4.12 The HELP option of QueryWindow ................................................. 50

viii

Figure 4.13 GLAD Top-level Window ................................................................ 51

Figure 4.14 Database Selection Dialog Box ....................................................... 52

Figure 4.15 The Data Manipulation Window (DMWimdow) ............................... 53

Figure 4.16 DMWindow's DESCRIBE option on Employee .............................. 54

Figure 4.17 GLAD Browse and Display Windows ............................................. 55

Figure 4.18 Initiating a Query from DMWindow ................................................ 56

Figure 4.19 Query ready to be sent to MBDS from QueryWimdow ..................... 57

Figure 4.20 Awaiting Results from MBDS ......................................................... 58

Figure 4.21 The Results of the Query displayed in the BROWSE Window .......... 58

ix

ACKNOWLEDGMENTS

I would like to express my sincere thanks to the people who helped me prepare and

implement this thesis. I would like to thank my advisor Dr. C. Thomas Wu for his help

in the conception and preparation of this thesis.

I would also like to thank my family, particularly my beautiful wife Susan for her

patience, support and love, without which none of this would have been possible. And

my children, Julianne, Christopher, and William who make each day brighter than the

day before.

x

L INTRODUCTION

A. BACKGROUND

As the 90's begin, we are at the dawn of the "paperless ship" concept. This concept

was first made popular by a former director of Surface Warfare, VADM J. Metcalf, USN

(Retired). Studies have determined that an Oliver Hazard Perry guided missile frigate

(FFG-7 class) with a crew of 185 men, and nominal 3500 ton displacement carries in

excess of 20 tons of paper required for the ship's mission and crew [Ref. 1:pp. 157-1591.

The goal of the "paperless ship" is to reduce and ultimately eliminate tons of paper. This

reduction would allow the installation of more offensive or defensive weaponry to

improve all ship's ability to fulfill its required mission. It would also greatly reduce the

manpower and man-hours required to maintain this paperwork. This thesis will present a

tool using existing hardware and software to make the "paperless ship" a reality

tomorrow.

Tactical computers have been in the Navy for decades. Non-tactical computers have

only been in service on board ships for the last 15 years. The largest program at present

is the Ship's Non-tactical ADP program (SNAP II). While SNAP II was a giant leap

forward toward reaching the goal of the "paperless ship", it fell far short of its mark. At

times it seems to add paperwork. The SNAP II used hardware of the 60's with software

of the 70's and didn't reach the majority of the ships until the mid 80's. We need

something better for the 90's.

On the average Destroyer, the SNAP 11 system consists of one Harris mini computer

with a storage capacity of 80 Mbytes hooked up to 6 to 8 dumb terminals. The softwareis still being added to, but some of the programs it handles are supply requisition and

inventory, Personnel Qualification System, and several simple tickler files. It also has a

limited word processing ability. It takes lots of man-hours to properly train individuals

on the basic functions of the system with each section requiring its own specific lessons.

With several terminals in use at the same time, which is a normal situation on most

ships, the systems performance degrades drastically.

The second major step forward occurred in 1985 when Zenith Data Corporation was

awarded a DOD contract to provide PC's, Zenith 248 AT compatible computers for the

Defense Department. Before that time, there was no standardization which led to a lot of

incompatibility of equipment. Also, for a command to purchase a computer it had to

write a letter of justification which took six months to get routed and approved. Then it

took an additional six months for Zenith and the supply system to deliver the units. After

the standardization, and when supply was able to keep up with the high demands, ships

and squadrons were able to receive several units.

B. THE NEED FOR RESEARCH

The situation as we enter the 90's is that a destroyer class ship has a SNAP II system

installed with 8 terminals and 5 to 7 Zenith 248 computers which are stand alone units.

This Thesis will propose that we can greatly improve the ship's ability to

0 reduce paperwork

* reduce man hours

* increase utilization and performance of the SNAP II system

• increase utilization and performance of the Zenith 248's

• by use of a graphical interface to simplify procedures for all users

Using the Zenith 248's as the front end would greatly reduce the load on the SNAP II

system since a majority of the work could be done on the 248's own processor, and only

2

access the SNAP's for specific information. The 248, using commercially developed

software, can handle a majority of the programs that are now done on SNAPs. With

more terminals available, time will not be wasted waiting for an open one. Using GLAD

provides an interface where the user is able to directly manipulate the required data.

Given the diversity of users, direct manipulation of logical objects is appealing to

novices, easy to remember for intermittent users and rapid for frequent users. [Ref. 2].

The focus of this research was to test the feasibility of providing such a graphical

interface from a front-end, in this case, a Zenith 248, and a backend database such as

SNAP II or its replacement.

C. THESIS ORGANIZATION

Chapter II provides a discussion of Object oriented programing and the Actor

software development environment.

Chapter III provides a description of the Multi-Lingual, Multi-Model, Multi-Backend

Database System (MBDS) and its Attribute Based Data Language. It discusses the

connection between the Backend and the Front end through a socket interface design by

another thesis student.

Chapter IV explains the implementation details of the query interface. First it looks

at the Graphics Language for Database (GLAD) background, and the reason it was

chosen as the interface for use in the system is discussed. Then it describes the

modifications and improvements to GLAD. And the specific implementation of the

QueryWindow, the sending of ABDL Queries and the data it receives back from MBDS,

as well as some of the associated implementation difficulties are presented. And lastly, a

sample session of the research results running in GLAD is given. The various windows

that can be manipulated are illustrated and described.

3

Chapter V concludes with a summary discussion of the research and possible

enhancements as continuation of research in this area.

I ! I I4

H. OBJECT-ORIENTED PROGRAMMING AND THE ACTORENVIRONMENT

A. OBJECT-ORIENTED PROGRAMMING (OOP)

1. Introduction

Object-oriented programming is a new and powerful programming environment.

Rather than working with traditional procedures, subroutines and separate data structures,

the programmer creates objects which control both the data structure and the operations

on that data. One of the goals of object-oriented programming languages is to reduce the

coding required to be written and maintained. This is accomplished by allowing the

programmer to build classes of reusable objects which encapsulate behavior and ensure

data abstraction.

Many languages claim to be object-oriented languages, however, in order for a

language to be considered object-oriented it must meet three criteria [Ref. 3:p. 1]:

* encapsulation of data and instructions into units of functionality called objects

* inheritance of functionality through a class hierarchy

, dynamic run-time binding of messages sent to objects

Languages such as Ada, Modula-2, and C++ which are advertised as object-oriented

languages fail to meet all three criteria. The Actor environment provides for

message-passing paradigm, inheritance, and polymorphism, the major characteristics of

object-oriented languages. Actor is an object-oriented programming language (OOL) for

MS-DOS microcomputers from The Whitewater Group Inc. The Actor environment will

be discussed in detail later in this chapter.

5

The basis of object-oriented programming is the creation and management of

objects. This is obtained by using the fundamental concepts in any OOL which are

object, class, and message.

2. Fundamental concepts of Object-Oriented Language

a. Objects

An object is a programming entity that resembles both tangible and intangible

real-world objects. An object has attributes and responds to instructions. At first it is

difficult to grasp the concept of an object. But we deal with objects constantly (people,

cars, pictures), OOP represents these physical objects as computer objects. For

example, an object as a functional entity is a car. A car object has attributes such as

model, engine, year and color. A car also responds to certain actions or instructions,

such as go (step on the gas), stop (step on the brake), turn (turn the wheel). When you

want the car to go, you are not interested in the drive train or the engine. All cars are

driven the same way, regardless of model or year. This is called data abstraction, the

ability to manipulate an object's data without knowledge of the data's internal format.

The big difference between procedural languages and object-oriented languages is that in

procedural functions work on data passed to them as parameters, while in object-oriented

you send a message to the objects to perform operations on themselves. In Actor, many

entities normally considered data structures are actually objects. For example, integers,

characters, strings and files are considered objects.

b. Classes

A class defines the structure and behavior of an object. A class describes

what is common in a category of objects, such as: the class of ships or class of students.

Any class describes a set of objects, where these objects are called instances of a class.

The instructions that an object can respond to are managed by the class, while the data

6

associated with a particular object is managed by the object itself. Using the previous

car example, Dodge is a class of car, and all Dodge cars belong to the class, but you

might have a red Dodge Daytona and a blue Dodge Caravan. The stucture of a class is

defined by instance variables which contain the data private to that class. The behavior

of an object of a class is defined by its methods. Methods allow other objects to access

this data.

c. Messages

Objects perform operations in response to messages. An object responds to a

message based on a behavior defined by the object's methods. Again back in the car,

when we press on the gas pedal, we send a go message to the car object. The car object's

transmission system has defined methods to respond to the message, increase fuel,

increase engine rpm.

There are two types of methods, what we have been using are called object

methods. These are associated to the instances of the class, and only allow messages to

that instance of the class. We need to be able to send messages not to the instances but to

the class itself. The best example of this is the new method to create a new object of a

class, it can't be an object method because the object does not exist, so it is handle by a

class method.

How does Actor execute methods and messages? A method gets executed by

sending a message to an object. The format for a message in Actor consists of a

selector, a receiver, and a list of arguments. When a message is sent to an object, it

looks to see if a method of the same name as the selector exists, if so, it executes the

method. If it fails to find a method within the instance of that class, an error message is

generated. The syntax of a method definition in Actor is:

7

/* Comments *!

Def <methodName>(self [argument list [I <local variables>]])

statement 1;

statement 2;

statement n;

!!

Actor methods can take up to eight arguments, and up to eight local variables. The local

variables are assigned and exist only during the life of the method. The above method

can be executed by sending it a message:

methodName( Receiver, arguments);

The selector would be "methodName", the receiver is "Receiver" , and the list of

arguments "arguments".

3. Inheritance, Polymorphism and Encapsulation

a. Inheritance

Inheritance is a mechanism for sharing behaviors between classes. In Actor,

each class inherits behavior from classes above it, its ancestors, and passes down

behavior to classes below it, its descendants. This behavior means that a descendant

class has access to all its ancestor's instance variables and methods, in addition to its own.

Actor uses single inheritance where each class is permitted only one direct ancestor.

[Ref. 4:p. 39]

This inheritance works throughout the Actor class tree, which is the

hierarchical ordering of all its classes. The most generic classes are at the top and the

8

more specialized classes at the bottom. All new classes must be descendants of classes

already defined in Actor. Since all classes are descendants of Object class, all classes

inherit methods and instance variables defined for the Object class.

When a message is sent to an object, the methods defined for the class which

this object belongs to are first searched. If there are no corresponding methods, then the

methods defined for the object's immediate ancestor class, parent class, are searched. If

again the search fails, then the methods of the object's grandparent are searched. This is

repeated all the way to the Object class.

In our previous example , the car class defines how cars in general behave.

The class Dodge inherits the general car behavior from car class, and adds behavior that

is specific to Dodge cars. But not all Dodges are the same so we define a Caravan class

which inherits from first Dodge class, then car class. Assume all Dodge's use the same

transmission, so that method would be defined in the Dodge class. When we press on the

gas pedal of a Caravan, a go message is sent. The Caravan class does not define a go

method, so the search continues to Caravan's immediate ancestor class, Dodge class. The

go method of Dodge is then executed.

b. Polymorphism

Polymorphism literally is defined as "the ability to take several forms". In

OOL, it is used to describe a situation where the same message causes different responses

depending on who the receiver of the message is. Actor allows different classes to have

the same method names. The methods could also have totally different implementations.

The result is that we can send the same message to different objects to produce different

responses. Polymorphism allows us to write generic reusable code more easily, since we

can specify general instructions and delegate the implementation details to the objects

9

that are involved. This decreases the dependencies in the code and maintenance is

therefore easier.

In the Dodge class, we can define a basic stereo method which says all

Dodges have AM/FM radios. In the Caravan we can define a separate stereo method that

states that all caravans have AM/FM cassette radios. The program determines at

run-time who the correct receiver of the message should be so that the correct stereo

method is executed.

c. Encapsulation

One of the main goals of object-oriented programming is encapsulation. It is

accomplished by allowing access to data only through its own methods. No other parts

of the program can operate directly on another object's data. Therefore, this ensures that

the proper instructions are operated on. This allows many objects to respond to the same

messages but will execute their own methods. A program can send a generic message

and leave the implementation up to the receiving object. This decreases

interdependencies, and improves interchangeability and reusability.

One last look at our car example, we can think of a car's brake system as being

encapsulated. Although brakes may differ in implementation, disc or anti-lock, they are

all used by the driver by using the pedal: step on the brake pedal to stop the car, then let

go of the brake pedal and keep moving . It does not matter what type of brakes a car

has, that detail is insulated from the rest of the car and the driver. That makes it easy for

a driver to be able to use any car.

4. Object-Oriented Programming Summary

Procedural programming and object-oriented programming are quite different,

and understanding OOP was the first obstacle to overcome to implement this thesis.

Object-oriented programming closely links data and procedures as objects. The main

10

reason for using object-oriented programming is the ability to reuse code and develop

more maintainable systems in a shorter amount of time.

B. ACTOR ENVIRONMENT

1. Microsoft Windows

Since Actor is a Microsoft Windows (MS-Windows) application, to use it we

must know how to operate Windows in order to use it. Windows is a visual extension

of MS-DOS that layers itself upon DOS to provide the user with a friendly, graphical

interface. See Figure 2-1 for a graphic depiction of this concept. In Windows, the user

can execute multiple programs simultaneously in an integrated environment, which gives

the user a consistent interface whatever the application. Windows does not require the

User

Figure 2.1 Windows layered over DOS

11

users to memorize command line Commands and their syntax. This reduces the learning

curve for all window applications dramatically.[ Ref. 5: p. 4]

a. MS-Windows requirements

MS-Windows runs on IBM personal computers or compatibles. Any system

on which you install Windows must meet the following minimum requirements:

A personal computer with two floppy disk drives or a fixed hard drive.

512K of memory (640K or greater is recommended)

DOS version 2.0 or greater

A monochrome or color monitor with graphics card

Windows can be operated without a mouse, however, we will describe

Windows operations using a mouse, because Actor requires one.

12

b. Sample Windo~w

Figure 2.2 shows a typical Notepad editor window, in MS-Windows

svt Caption bar Maximize boxmnu box (oMileba inimize ox

Pull-down --- PseShift-)-lnsm ===nmm====

Menu DOCUM Seet all -0us

Sizing Page 182. "Hicrosoft Windows User'border The manual says the PIF Editor. PI

the PIF directory. a subdirectoryProgram's Actually. it is in the main Window

cliet ar Page 228. *'uicrosoft Windows User'(work area The manual says that If '*you dont Scroll

SMART~rive will receive 256K (the bars

Cminimized 011.1* N3 I I .....

Figure 2.2 Sample Window

environment. Each element of Figure 2 .2 will be briefly described. [Ref. 6:p. 7]

o The Mouse pointer will show-up as an arrow pointer.

o The Program's client area (Work area) is the working area of the window.We can edit text or graphics by using the keyboard or the mouse.

o The Icons representing applications that have been midnimized by clicking onthe minimize box, located in the right hand corner, appear in the Icon area atthe bottom of the screen.

o The Caption bar (title bar) displays the name of the application in thewindow. In Figure 2-2, it is the Notepad. If the window is active, the area to

13

the left and right of the title will be filled in with a color (if capable) orgrayed to show that this is where you are working.

• The System Menu box can be used to display the System menus in theapplications. This menu is common to all Windows programs.

* The size box can adjust the size of the window by clicking on it with themouse and dragging it to either increase or decrease the window.

" The Menu bar is similar to the System Menu bar, but this controls the featuresunique to this window.

0 A Pull-down Menu is a submenu of an item displayed in the Menu bar. Ithelps organize features and reduces clutter.

* The Maximize box increases the window to fill the entire screen, while theminimize box reduces the window to a Icon representation at the bottom of thescreen.

" Scroll bars appear when there is more than one screen of information to bedisplayed.

" A vertical line 1, 1- Beam, indicates that text input is required in that

specific part of the window.

c. Dialog Box

For short, simple communications between a Window application and a user, a

special window called a dialog box is used. Figure 2-3, shows a sample dialog box from

PCPaint. Dialogs are used to get specific information required by the application or to

warn the user of some error. They may contain several types of control devices, for

example;

* push buttons

• radio buttons

* check buttons

• edit fields

14

* list boxes

MS-Wndows provides a visual interface in the form of windows that contain graphic

representations of user input and system output. The Menus are the principal means of

Enter print options ..

Number of copies: = OK Default

-.quality Window- ushRadio uttoButton- rt It 'U 'ole

\0Proof 0 Partial

Figure 2.3 Sample Dialog Box

presenting the user options within an application. MS-Windows provides the

programmer over 600 "Kit routines" to develop application programs to run under its

user interface for its software development.

2. Actor

Actor is a MS-Window application; but unlike other Window applications, Actor

provides its source code in the form of predefined classes. This allows programmers to

access the Actor functions as well as all the MS-Window's functions. Actor provides

both the user and the programmer a very friendly environment, since the MS-Windows

operating environment is used. It is much more suitable for programming MS-Windows

than Microsoft C. With Actor's predefined classes, a programmer can write just a couple

15

of lines in Actor that would take literally several pages of C code. This type of coding

allows rapid prototyping and testing of applications. Actor provides several tools for

software development, which will be discussed later in this chapter.

The first thing you will see upon entering the Actor environment is Figure 2.4, the

About Actor box. By clicking on this box with the mouse, we enter the world of

am/ mIItik, Wh i:L uie Group , III(:

Il [i cr Io i 11 o lpora[i l a

Figure 2.4 The Actor About Box

object-oriented programming of Actor and can take advantage of the rich interactive

programming of MS-Windows.

16

a. Actor requirements

Actor version 1.2 requires:

• All the requirements of MS-Windows plus

• 640K of memory

0 a hard disk

* graphics display and adapter

* mouse or other pointing device

This thesis research was successfully tested on a Department of Defense's

standard contract Zenith 248 microcomputer in its standard configuration.

b. Starting Actor

When we first begin Actor, two windows come up, The Display and the

Workspace. The Display window is used by the Actor environment to print system

messages, especially error messages. The Workspace window is the heart of the

environment. It is here that the programmer brings up other windows, such as the

Browser ,or, Inspection, and perform system level commands; Doit!, Cleanup!. These

windows and the system commands will be discussed later.

c. Workspace Window

The Workspace is the main window of Actor. Figure 2.5 shows the Workspace

window. There are ten menu choices. The selections with exclamation point means their

are no pull-down submenus. The File, Edit, Utility, Templates menu items all have

submenus. Actor uses static and dynamic memory, the Show Room! menu displays

current memory usage. The Cleanup! menu item initiates a garbage collection function.

The Doit! menu item will execute a single command or a series of highlighted

commands. The Inspect! and Browse! open the Inspector and Browser windows

17

Eile Edit boit? Inspect? Brouse? rleanup?.how Room? utility lemplates Demos?

San :- new(GladVindow,nil,"GladTop~enu","G L A D +show(Sam,1);

Sam :- new(QueryWindo,nil,'QueryGlad","G L A D"show(Sam,1);

load ("listwind. lod");loado;LW :- defaultHew(ListWindo."TEST");show(LW,1);

4- 4

Figure 2.5 Actor Workspace Window

respectfully. Both windows will be discussed in the following section. The File choice

includes commands concerning files, saving and editing work, and running other

MS-Windows programs. The Edit provides the ability to cut, copy, paste and clear text.

The Edit menu choice reappears in several of the other windows. The Utility! menu item

gives you methods to search through Actor code to find out which classes define or call a

particular method. The Templates allows the programmer to pick a control structure

like do, if/then, and case. It then places that template into the Workspace where the

programmer can fill in the rest of the code.

d. Browser Window

To open a Browser window, click once on the Browser! in the above mentioned

Workspace menu bar. The Browser window, Figure 2.6, is used to create, modify or

destroy classes. It is through this window that we gain access to the powers of Actor.

The Browser is where the programmer does most of his work. This window allows us to

18

Clas's Instance

WorkEdit Do4tt cnspect apt u

Clse e tr~slF dbam.qsloj h andsmktslb t ClsIi+itueenulDersHe hod

Clse showself.1)editrocdd w tendov qUpdate,

ftthod hEocketsarent etResult%o r k Edt CRect 1

Def start(self, qdbHane qselbj

Figureelbjct 2.Chlrwsrwno

Edit boxwhich In~tHenuID(self) ;seTect:: show(self,1) ;Pberhod r" hSockets :- handSocket;ode sel~bJ Han:-sel~bJect ;

db~ame :-qdbltane;selObJ : qsel~bj ;

Figure 2.6 The Browser window

examine, edit and add to Actor source code, and in the process, Actor is changed to

reflect any changes in the code. The Browser is a specialized file editor designed

specifically for manipulating the class source files. Figure 2.6 shows a sample Browser

window, the class that has been selected is the QueryWindow class which is the main

class for this thesis. This class has several methods that allow a user to formulate ABDL

queries and send them to the Backend data server, but this will be discussed in more

detail in the next chapters. The method being edited is the start method and its code is

then placed in the edit box where it can be added to or modified. [Ref 7:p. 4-15]

e. The Inspector and Debug Windows

The Inspector is used to examine the value of objects. To use it, select or

highlight any object in the Workspace and then click on the menu item Inspect!. The

Inspector window then comes up. In the upper left comer, we have a list box showing

19

names of the named instance variables. In the right corner, the keys to the indexed data

is displayed. We can select any instance variable and its value will be displayed in the

edit box at the bottom of the window. [Ref. 4:p. 1.3.5]

The Debug window is an important tool for the programmer. It combines the

features from the Inspector and the Browser to allow for diagnosing and correcting

programming errors "on the fly". It allows for modification of the program while it is

running and will resume the operations with the new corrections. The Browser window

catches syntax errors during compile time. The Debug window identifies run time errors

and allows the programmer to correct the error while still in the running program. This

is a great time saver, being able to accept (compile) and resume. The programmer can

place breaks in his program to do some debugging. When the program reaches a break

command it initiates the Debug window. [Ref. 4:p. 1.3.7]

C. SUMMARY

The goal of this chapter was to briefly introduce some of the key terminology used in

object-oriented programming, and to familiarize ourselves with the Actor environment.

Objects, classes, messages and methods are the building blocks in OOP, and are used by

Actor to create programs. Actor runs under MS-Windows and provides the programmer

its source code to develop applications under a user-friendly software development

environment.

20

HI. BACKEND DATA SYSTEM AND SOCKET INTERFACE

A. BACKEND DATA SYSTEM

1. Database Management System DBMS

Over the past twenty five years, many different data models have been developed,

starting with traditional data models( such as the relational, the hierarchical and the

network models) to the newer, semantic data models( such as functional data model and

the entity-relationship model). This led to the implementation of several different

DBMS models and languages. Different database models could not use other models

data. In fact, updating equipment or a modification of the DBMS software would cause

previous transactions to be unusable. In the past couple of years, the ability to network

has increased the need for a new all encompassing DBMS. Users can access data or

databases around the globe, but because of the many different and unfamiliar languages

and models, they can't use the data unless they have people and equipment set up for the

specific model .Multi-lingual, Multi-Model, Multi-Backend Database System provides a

solution: this system allows the user to use/query any DBMS regardless of the specific

model, and without concern for the data manipulation language. For example, it will

allow a query of a network database via SQL transactions.

a. Multi-Lingual Database System

( MLDS) is a single database system that can execute transactions written

respectfully in different data languages and support the structure of various data models.

It is able to support all the different data models and languages, with a single underlying

database system. This system is referred to as the kernel data model (KDM) and the

kernel data language (KDL). Figure 3.1 shows the system structure of the MLDS. The

21

user interacts with the system through the language interface layer (LIL), using

a chosen user data model (UDM) to issue transactions written in a corresponding

UDM User Data Model Data Model

UDL User DAta LanguageLIL Language Interface LayerKMS &Kernel NappLng System Data LanguageKC aKernel ControllerKFS Kernel Formatting SystemKOM :Kernel Data ModelKDL sKernel Data LanguageI I System oduleKOS aKernel Database SysteSt

Information Flow

Figure 3.1 The Multi-Linqual Database System [Ref. 8:p.12]

model-based user data language (UDL). The LIL sends the user transaction to the

kernel mapping system (KMS) . The KMS executes one of two possible tasks. The

KMS transforms a UDM-based database definition to a database definition of the kernel

data model (KDM), when the user specifies that a new database is to be created. When

the user specifies a UDL transaction is to be executed, the KMS translates the UDL

transaction to a transaction in the Kernel data language (KDL) equivalents.

In the first task, KMS forwards transaction in the KDM data definition to the

kernel controller (KC). KC, in turn, sends the KDM database definition to the kernel

database system (KDS). When KDS is finished with processing the KDM database

22

definition, it informs the KC. KC then notifies the user, via the LIL, that the database

definition has been processed and that loading of the database records may begin.

In the second task, KMS sends the KDL transactions to the KC. When the KC

receives the KDL transactions, it forwards them to the KDS for execution. Upon

completion, the KDS sends the results in the KDM form back to the KC. The KC routes

the results to the kernel formatting system (KFS). KFS reformats the results from the

KDM form to the UDM form. The KFS then displays the results in the correct UDM

form via LIL. The LIL, KMS, KFS, and KC define the language interface for a single

user-defined data model. In a MLDS, a separate language interface is required for each

model defined. This is shown in figure 3.2.

Figure 3.2 Multiple Language Interface

23

In the current system, there are four unique language interfaces defined.

" relational/SQL model

" hierarchical/ DL/I model

" network/CODASYL-DML model

" functional/Daplex model

These have been developed and implemented by previous thesis students under

the guidance of Prof. David Hsiao and his assistant Mr. Thomas Chu. In contrast, the

KDS structure is a single, common component shared by all models. The KDS allows

the various user-defined language interfaces to access and manipulate the physical

database. The attribute-based data model and attribute-based data language (ABDL)

have been implemented as the KDM and KDL, respectively, for the MLDS. The ABDL

will be discussed later in this chapter. [Ref. 9:p. 11-13]

b. Multi-Model Database System

The multi-model database system is an improvement on the MLDS. It allows a

user to query any database using a data manipulation language of his choice, regardless

of the underlying data model. An example might be, a user can utilize a SQL query

transaction to access a hierarchical database. This allows existing databases and query

languages to be used when upgrading to a new database system. No longer do we have

to retrain people or rewrite the database every time we expand. This reduces error

caused during translation of existing database and existing queries into new systems.

The mixed-processing strategy is implemented to carry out the cross-access of

the databases as shown in Figure 3.3. Two components are involved, the schema

transformer and a second language interface. When a user selects a database that is not

in the local LI, language interface, all other LI's are searched for the desired database.

Upon finding the database, the original database schema is copied and transformed into

24

Figure 3.3 The Mixed-Processing Strategy

an equivalent schema in the local LI. When a user executes a transaction in the local data

manipulation language, the new language interface processes the request. The attribute

based request's output from this language interface is in the form of the original database

model which thereby eliminates the need for an extra language translation step. [Ref. 8:

p. 34]

c. Multi-Backend Database System

The Multi-backend database system overcomes the performance problems and

upgrade issues related to the traditional approach of database system design. This is

accomplished through the utilization of multiple backends connected in parallel fashion.

These backends have identical hardware, replicated software, and their own disk systems.

A backend controller is responsible for supervising the execution of the database

transactions and for interfacing with the hosts and user, see Figure 3.4 . The backends

perform the database operations with the database stored on the disk system of the

backends.

25

As Shown in Figure 3.4, the user access is accomplished through a host

computer to the controller. When a transaction (a single request or a sequence of

requests) is received, the controller broadcasts the transaction to all the backends. Since

the database is distributed across the backends, all the backends processors execute the

same request in parallel. Each backend maintains its own request queue. As soon as a

Baikend 1Ta Diska sbtControinest

proes th nxt eqestinepndet f te the bckedsc[ef. 2Op 32-33

Transactoon raind onstant te DerS

woldcase the respns tun fo a srtascinwe h ubrackends

Answer

Backend N Diskt ~ l e r

Figure 3.4 The Multi-Backend Database System

backend fiishes a request, it sends the result back to the controller and continues to

process the next request independent of the other backends. [Ref. 10:p. 32-33]

Performance gains are obtained by increasing the number of backends. For

example, if the size of the database and the transactions remain constant, then MBDS

would decrease the response time for a user transaction when the number of backends

increased. Even more important, if the database or the transactions increased in size,

MBDS could maintain an invariant response time with proportional increase in backends.

26

2. The Data Model and Data Language

The goal of the data-model transformation and data-language translations is to

maintain semantic preservation of the database and operational equivalence of the

transactions. As stated above, the attribute-based data model and ABDL have been

implemented as the KDM and KDL respectively in the multi-lingual database system.

a. The Attribute-Based Data Model

In the attribute-based data model, the data has the following constructs:

• Database consists of a collection of files

" File contains a group of records which are characterizedby a unique set of keywords

• Record is made up of a collection of attribute-value pairs

" Attribute-value pairs is a member of the Cartesian product of the attributename and the value domain of the attribute.

For example, <model,"Caravan"> is an attribute-value pair having "Caravan" as

the value for the model attribute. A record contains at most one attribute-value pair for

each attribute defined in the database. Certain attribute-value pairs of a record are called

the directory keywords of the record, because either the attribute-value pairs or their

attribute-value ranges are kept in a directory for identifying the records. Those

attribute-value pairs which are not kept in the directory are called non-directory

keywords. An example of a record is shown below.

(<FILE,USCars>,<MAKE,odge.,cMODEL,Caravan>,lmini-van))

The angle brackets, <,>, enclose an attribute-value pair, i.e., keyword. The

curly brackets , (j, include the record body. The first attribute-value pair of all records

contains the attribute FILE and its value is the file name, in this case, USCars.

27

There are two major reasons for choosing the attribute-based data model. First,

the attribute-based data model is data independent, by this we mean, implementation and

application independent. All of the constructs mentioned above are not dependent on a

specific implementation or application. Second, the model allows the user to take

advantage of certain constructs for system optimization.

b. The Attribute-Based Data Language

The attribute-based data language (ABDL) supports five primary database

operations, INSERT, DELETE, UPDATE, RETRIEVE, and

RETRIEVE-COMMON. A request is the primary operation in ABDL. Each request

contains a qualification which is used to specify the part of the database that is to be

operated on. Two or more requests may be grouped together to form a transaction. The

five operations will be shown below. It is through these transactions that we are able to

query and modify the database. These are very important to this thesis, their importance

will be shown in chapter four.

The INSERT request is used to add a new record into an existing database.

The qualification of an INSERT request is a list of attribute-value pairs and record body

being inserted. For example, the following INSERT request

INSERT(<FILE,USCars>,cMAKE,Ford>,cMODEL,Tempo>)

will insert a record into the USCars file for the Make Ford with a Model Tempo. This

record does not contain a record body.

The UPDATE request is used to modify records of a database. There are two

parts of the qualification of the UPDATE request. The two parts are the query and the

modifier. The query specifies which records of the database are to be modified. And the

modifier specifies how the records being updated are to be modified. For example, the

following UPDATE request

28

UPDATE (FILE=USCarsXMODELYEAR=90)

will modify all of the records of the USCars file by changing all the model years to 90.

In the above request, the (FILE=USCars) is the query and (MODELYEAR=90) is the

modifier. Another example for when you only want a specific part of your database

updated is shown below.

UPDATE((FILE=USCars)and(MAKE=AMC))(MAKE=Chrysler)

This example will change all the records in USCars of make, AMC, to replace AMC with

Chrysler. The query is ((FILE=USCars)and(MAKE=AMC)), note the placement of

parenthesis, and the modifier is (MAKE=Chrysler).

The DELETE is used to remove one or more records from the the database.

The qualification of a DELETE is a query. For example, the following request

DELETE((FILE=USCars)and(MAKE=Edsel))

will delete all records whose make is Edsel in the USCars file.

The RETRIEVE request is used to access records of the database. the

qualification of a retrieve consist of a query, a target-list, and a by-clause. Again the

query specifies which records are to be retrieved. The target-list consists of a list of

attributes whose attribute values are to be output to the user. The optional by-clause may

be used to group records. The following RETRIEVE request

RETRIEVE((FILE=USCars) and(MAKE=Chrysler))(MODEL)

will output to the user the model names of all the records in the USCars file with a make

of Chrysler. In the above example the query was ((FILE=USCars)

and(MAKE=Chrysler)), the target-list was (MODEL),and the by-clause was not used.

Here is a RETRIEVE request using the by-clause.

RETRIEVE(FILE=USCars)(MAKE,MODEL,MODELYEAR)BY MAKE

29

This example will list the make, model, modelyear of all the records in USCars by their

make.

The last request is the RETRIEVE COMMON. It is used to merge two files

by a common attribute-value. This request can be considered a transaction of two

retrieve requests with a common clause in between that are processed serially in the

following general template.

RETRIEVE(query-1)(target-lIst-1)

COMMON(attribute-1,attribute-2)

RETRIEVE(query-2)(target-list-2)

The Common attributes are numbered according to their respective RETRIEVE. For

example, The following RETRIEVE-COMMON request

RETRIEVE((FILE=USCars))(MAKE,MODEL)

COMMON(MODELYEAR,MODELYEAR)

RETRIEVE((FILE=G ERMANCars))(MAKE,MODEL)

will find all records in the USCars and GERMANCars with the same MODELYEAR and

return a list of the MAKE and MODEL. In this case, the target lists of the two

RETRIEVE requests are the same but that is not required.

These five database operations are simple, yet powerful enough to be complete.

They are complete in the sense that typical storage, retrieval and update of data can

easily be accomplished.

B. THE SOCKET INTERFACE

1. Socket Interface between MBDS and GLAD

The Socket interface was written by LT. Hogan [Ref. 11]. It required the

integration of three separate programming tasks, in three different programming

30

environments. The first task was to implement a "server" version of the MBDS system

which would allow the GLAD system to remotely interact with MBDS. The second task

involved implementing a separate socket interface written in Microsoft C that the

personal Computer using windows could connect to MBDS. The last task was to connect

SENDING SOCKET

RECEIUING SOCKET

Is'MINICOMPUTER GLAD

IS SOCKET THERNET ETWORV INTERFACEI NTERFACE

IBM PC

FIGURE 3.5 MBDS/GLAD Interface

the Window's socket to the Glad Environment. Figure 3.5 shows an overview of the

MBDS/GLAD interface.

a. The MBDS Socket Interface

The MBDS Socket Interface establishes a communication link via an Ethernet

network from the backend, in this case the ISI minicomputer to the front end, an IBM

compatible PC. To enhance the reliability of the system and to aid in debugging, LT.

Hogan chose to use separate sending and receiving sockets on both the backend and the

front. As shown in Figure 3.5, all the queries from GLAD are sent via DDE, dynamic

31

data exchange, by messages to the GLAD socket interface, which transmits them

through its sending socket to MBDS's receiving socket. On the reverse, all MBDS data

and error messages are sent through MBDS's sending socket to the GLAD socket

interfaces' receiving socket, and are then sent via DDE messages to GLAD.

To activate the MBDS socket interface, they created a Test Interface, TI,

portion of MBDS. The TI is the user-interface for MBDS and presents the user with the

following top-level menu upon starting MBDS.

The Multi-Lingual/Multi-Backend Database System

Select an operation:

(a) - Execute the attribute-based/ABDL interface

(r) - Execute the relational/SQL interface

(h) - Execute the hierarchical/ DL/I interface

(n) - Execute the network/CODASYL interface

(f) - Execute the functional/DAPLEX interface

(g) - Execute the object-oriented/GLAD interface

(x) - Exit to the operating system

Select->

At the present time, a user must first log onto the ISI minicomputer and start the

Multi-Lingual/Multi-Backend Database System. To initiate an interface with the GLAD

system, a user selects operation (g) which sets up the MBDS socket interface. This must

be done prior to attempting to open any MBDS databases from the GLAD system on the

PC. A future enhancement will be able to place the MBDS in the server mode directly

from within GLAD.

The receiving socket is set up first. Then the sending socket is created and the

MBDS system enters its server mode, awaiting messages from GLAD. Messages are

32

sent over the network by sending the length of the message. Based on this message

length, storage is dynamically allocated for the incoming message. The first three bytes

of any message is the message type. Presently, three types of messages are supported by

MBDS. The three are open database, query database, and terminate session. If an

improper or invalid message is received, an appropriate error message is sent back to

GLAD.

The open database option allows GLAD to initiate an MBDS database for use.

An example of an open database message is:

010CARS

The 010 is the code used to signify that this is an "open database" message and CARS is

the name of the database to be opened. After all the records have been loaded, the user

and database IDs are broadcast to the 12 processes which make up the MBDS system. If

MBDS is unable to open and load the database properly, an appropriate error message is

sent over the network to GLAD. If MBDS is successful, and the database is loaded then

MBDS waits to process other incoming messages.

The query database option allows the GLAD user access to the data in any

previously opened MBDS database. Below is an example of a "query database" message.

020CARS@[RETRIEVE((FILE=USCars)and(MAKE=Dodge))(MODEL)]

The 020 is the code used to signify that this is a query database message. An "@"

symbol is used to delimit the end of the database name, which in the above query is

CARS. Anything following the "@" sign is the actual query itself. The query is sent to

the Request Preparation which handles the parsing and execution of the query. After

MBDS has processed the query, the results are gathered and translated to the GLAD's

data format, which consists of an "&" character following each attribute, and carriage

return and line feed (CR-LF) at the end of each record. MBDS uses an "@" symbol

33

rather than the CR-LF at the end of each record in order to transmit the results through

the socket in one continuous stream. On the GLAD side, the GLAD's socket interface

saves the results in a text file, and replaces the "@" symbols with CR-LFs. MBDS has a

restriction on the length of the query result responses. If a response is too large, it is

broken up into segments and an "end of results" marker is placed at the end of the final

segment. These segments are then transmitted back to GLAD, followed by a special

message indicating that all query results have been transmitted, and MBDS awaits the

next message from GLAD.

The Terminate Session option is sent when GLAD wishes to close the sockets

interface to MBDS. The message length of zero is transmitted. When MBDS receives

this terminate session message, it leaves the server mode, closes its sockets, and returns

to the top-level menu, allowing the user to restart a new session or select another MBDS

option.

b. The Glad Socket Interface

GLAD uses Window's Dynamic Data Exchange protocol to sends messages

with MBDS request to the socket interface. The socket interface receives these messages

in the form of WMDDEREQUEST messages in which the string containing GLAD's

request is referenced by an atom that is passed in the message. The message is then sent

to MBDS, first the message length then the message itself. There is no error checking on

the GLAD side, all of it is done on the MBDS side.

When MBDS returns the results from a query, they are stored in a text file

named "qresults.fil" on the PC. As mentioned above, the "@" symbol at the end of each

record returned by MBDS is replaced by a CR-LF combination prior to storing it in the

text file. Each record is stored on a different line in the GLAD data format. When all

34

the results of the query are gathered in the file, a WMDDEDATA message is sent to

indicate that the data has been received. [Ref. 12]

35

IV. IMPLEMENTATION

In this chapter, we will demonstrate the ability to use a Graphics Language Interface

on a front-end PC and link it to a MBDS backend. We will discuss the Graphics

Language for Database (GLAD), and why we used it. We will discuss some of the

modifications made to the existing GLAD, and what new classes were added. Finally,

we will present a sample session of GLAD with a sample database.

A. GRAPHICS LANGUAGE FOR DATABASE

1. Background

The Basis of this thesis was to explore the possibilities of providing a graphical

interface on a PC to a MBDS backend. GLAD is an ongoing project developed and

supervised by Professor C. Thomas Wu at the Naval Postgraduate School in Monterey,

CA. The reason for developing GLAD stems from the realization that an end-user visual

interaction tool was needed for the database systems. Glad will provide the end-user,

regardless of the type of database system (relational, network, hierarchical), with a

coherent interface. This will allow the user to visually interact with the system for data

manipulation and program development. The current GLAD prototype system is

implemented with data definition, data manipulation, on-line help system, and the ability

to store and manipulate graphic images as a part of a database.

2. Hardware and Software requirements

In chapter two, the fundamentals of object-oriented programming and Actor were

discussed. GLAD was developed using the Actor programming language under

MS-Windows version 2.1 . Using Actor allowed for rapid prototyping of the GLAD

36

system. For most programming languages, it takes a great deal of time to learn even the

basics. This is not the case of Actor, Actor allows the programmer to create simple

programs within a matter of days. The complexity of the programs grows rapidly. The

goal of this thesis was not to build a complete system, but a system that would

demonstrate the feasibility of implementing our goals. Actor gives the programmer the

flexibility to quickly test interface design alternatives and make changes to the designs

rapidly. See [Ref. 12,13,14] for a more detailed discussion of the advantages of using

Actor to implement GLAD.

The GLAD prototype system as it was implemented for this thesis requires the

following :

* IBM compatible computer (80286 or better)

* Minimum of 640K of memory (one to four expanded recommended)

0 Hard disk

* Graphics display and adapter (EGA or better recommended)

• Mouse (or other pointing device)

* Microsoft Windows version 2.03 or higher

* MS-DOS version 2.0 or higher

The network used for this thesis was the Ethernet computer network and it requires:

0 Excelan EXOS 205T Model 4 Intelligent Ethernet Controller Board

* Excelan LAN WorkPlace Network Software for PC DOS TCP/IP TransportSystem

* Excelan LAN WorkPlace Network Software for PC DOS Socket LibraryApplication Program Interface

37

The Microsoft Wimdows environment and that of GLAD are very CPU and Memory

intensive, so the amount of random access memory, hard disk access time and the speed

of the CPU determines the user response times. But for the prototype system, the Zenith

248 was sufficient for both development and implementation.

B. MODIFICATIONS

One of the great advantages in using GLAD under the Actor environment is the ease

at which a programmer can modify already existing programs. This modularity allows

changes to be made without having to change existing methods and in most cases, one

does not even need to know anything about other methods.

1. Resource File

The only change required in the ACTOR.RC file was the insertion of the menu

format for the new QueryWindow class. A complete listing of ACTOR.RC is contained

in Appendix A. A sample of the ACTOR.RC that was modified is listed below.

QueryGlad MENU

BEGIN

MENUITEM "&Send Query",21

POPUP "&Edit"

BEGIN

MENUITEM "Cu&t\4Shift+Del", EDIT-CUT

MENUITEM "&Copy\tCtrl+Ins", EDIT-COPY

MENUITEM "&Paste\tShift+Ins", EDITPASTE

MENUITEM "C&learzDel", EDITCLEAR

MENUITEM SEPARATOR

MENUITEM "Select &AINCtrI+A", EDITSELALL

END

38

MENUMTM "&Describe", 12

POPUP "Q&uery"

BEGIN

MENUITEM "&Ifsert", 22

MENUITEM "&Update", 24

MENUITEM "&Delete", 25

MENUITEM SEPARATOR

MENUITEM "&Retrieve", 23

MENUIT"EM "Retrieve &Commnon", 26

END

POPUP "&Templates"

BEGIN

MENUITEM "&Insert...... 32

MENUITEM "&Update...... 34

MENUITEM "&Delete...... 35

MENUITEM SEPARATOR

MENUITEM "&Retrieve. ...". 33

MENUITEM "Retrieve &Common....". 36

END

MENUITEM "&QUIT",lI1

MENUITEM '%-aFl Help", 1O,Help

END

This is the code required to set up the QueryWindow class menu. After all changes were

made the RC file was compiled, this produced a new ACTOR.EXE file with all the

* changes.

39

2. DMWindow Class

The Data Manipulation Window gives the user the ability to manipulate the

database schema and its data. Since GLAD is based on an object-relationship model,

objects (entities) of the database schema are shown as rectangular boxes in the

DMWindow. For this thesis, the only modifications to the DMWindow Class were the

addition of two methods. They were Query and returnQuery. The window for the

interface to allow queries of the MBDS is created in a class called QueryWindow. Since

QueryWindow is a descendent of EditWindow class and not DMWindow class, there

had to be a connection to pass information. The Query method initiates the call to

QueryWindow when Query is selected in the DMWindow, see figure 4.1. The Query

D14.indow Initiate QueryWindow

ShowtConnectlon Quit 1 Help

Eployee Epe4loyer Comipny

Figure 4.1 Initiate QueryWindow from DMWindow

method creates a new window called QueryWindow and passes pieces of information

from DMWindow that QueryWindow will need to properly access the records of the

MBDS. The returnQuery is a method that QueryWindow calls to use some of the

40

methods already built in DMWindow. This method is called from QueryWindow after a

record has been INSERTED, UPDATED, or DELETED. This is an example of the

reusability of previously written code. The code for DMWindow.cls is listed in

Appendix B.

C. IMPROVEMENTS

1. QueryWindow Class

The QueryWindow class gives the user a Window in which they call, create and

send Queries, see figure 4.2. At this time, it has been implemented to send queries to the

backend MBDS system, in the ABDL format. After the query has been sent the results

lend Query Edit Qescribe guery Jemplates ftUIT

F1 Help

Figure 4.2 QueryWindow

are then displayed in the Browse Window, which will be discussed later in this chapter.

One of the future improvements will be the development of a GLAD query language, and

a SQL query language to the MBDS. While in the QueryWindow, a user can select the

41

type of query they desire by selecting the Query option in the QueryWindow menu.

This causes a pop-up menu to appear which shows five options. The five options are the

five primary operations allowed by ABDL as discussed in the previous chapter. The user

can Insert, Delete, Update, Retrieve, or Retrieve Common. After making a selection

one a user friendly template will be placed in the QueryWindow's editable area with the

correct format for the query. This greatly reduces the amount an individual has to

remember about the syntax and decreases the amount of input required by the user. For a

more detailed template, the user can select the Templates option for whichever query he

desires. The Edit option gives the user the full power of an Edit Window, to make

corrections. The Describe option is the same as it is in the DMWindow class, it presents

the attributes of the Selected Object. The Send Query option sends the query formed in

the QueryWindow to the backend. The Help option gives a little explanation of how to

use the QueryWindow. The next sections will discuss each of these in detail. The code

for QueryWindow class is in Appendix C.

a. Edit

This menu option, when selected, gives the user a pop-up menu, see figure 4.3.

Fend Quer e 4 es rbe Query Iedoplates sUT

Cut Shft-Del F1 HelpCopy Cnt]L->]nsP ast!e Sftft-> !ns _Se]Lec T R1

Figure 4.3 QueryWindow Edit option selected

42

It allows the user to manipulate the query they may have written. This allows the user

to edit any errors quickly and easily. Since these are the standard edit functions used

throughout Windows, little if any learning is required to use them. From the pop-up

menu under Edit, the options available are:

" Cut - allows the user to remove the high-lighted text from the window andput it on the Clipboard.

" Copy - allows the user to make a copy of the high-lighted text from thewindow and it is placed on the Clipboard.

" Paste - allows the user to take what has been placed on the Clipboard andinsert it into the QueryWindow.

" Select All - allows the user to high-light all the text in the QueryWindow.

b. Query

This menu option, when selected, gives the user a pop-up menu, see figure 4.4.

This Query option gives the user five options; Insert, Delete, Update, Retrieve, or

,end querY Edit Describe lemplate

insert 4elpUpdate +Delete

BetrieueRetrieve Common

Figure 4.4 Que.'y option pop-up menu

43

Retrieve Common. After selecting one a user friendly template will be placed in the

QueryWindow's editable area with the correct format for the query. Figure 4.5 show a

sample of the results of selecting the Delete option. This greatly reduces the amount an

individual has to remember about the syntax and decreases the amount of input required

,lend Query Edit Describe Query Iemplates 2UITF1 Help

02FIRST@[DELETE((TEMP= Employee ) and ( ))]

4. .

Figure 4.5 Sample QueryWindow after the Delete option of Query

is selected

by the user. The message code 020 and the file that is open is automatically filled in as

well as the selected-object, in this case it is Employee. The only thing that the user needs

to fill in is the specifics of the qualification of the transactions. For example, he could

type in NAME=Hogan.

[DELETE((TEMP=Employee) and (NAME = Hogan))]

All five of Query options give the user similar templates

" Insert - 020FIRST@[INSERT(<TEMP=Employee>,< >)]

* Update - 020FIRST@[UPDATE((TEMP=Employee)and( = )) < = >)]

44

* Delete - 02OFIRST@[DELETE((TEMP=Employee) and (=

* Retrieve -020FIRST@[RETRIEVE(TEMP=Employee)( , ,

0 Retrieve Common - 020FIRST@[RETRIEVE(TEMP=Employee)( , ,

COMMON(, )[RETRIEVE(TEMP= )(, ,

These allow the user to do any type of data manipulation on the records from the

front-end PC more easily than a user can on the backend system as they exist today.

c. Templates

Every language has constructs that control the execution of a program. The

ABDL language is no different. The Template option , see figure 4.6, when selected

will display a more detailed template for each of the five ABDL operations. These are

lend Query Edit pescribe guer.

Insert ...Update ...elete ...

Betrieue ...Retrieue Gomon

Figure 4.6 The Template options of QueryWindow

displayed in a separate window above the QueryWindow so they can be visible for the

user while they type in their query. Figure 4.7 shows an example of the Delete

Template. A further enhancement will allow the user to copy and paste directly

45

between the Template Window and QueryWindow. There is a template for each of the

five ABDL operations.

Obkam.[ DELETE( (TEW-selfbj) and

(0ttrl - Jones) ]

Figure 4.7 Template Window for Delete

& Describe

The Describe option calls a method back in DMWindow class. This is useful

to allow the user to see the structure and the attributes for the selected-object that they are

presently working on. Figure 4.8 shows an example where Employee is the

selected-object and the Window shows Employee's four attributes NAME, AGE,

SALARY, and PHONE. This provides the user with all the information needed to

formulate the query correctly. Combining the templates for each query inserted in the

QueryWindow, and the more detailed templates accessed through the Templates option,

46

a user has a complete picture of what he needs for each query. All three windows remain

visible as long as the user needs them.

%end Query Edit hquerg e plates idIT[7l Help

Mane i String

Atge e hIt

Salary s Int

Phone e String

Figure 4.8 The Describe option or QueryWindow

e. Send Query

The Send Query option takes the query that is displayed in the QueryWindow

and sends it to the backend, see figure 4.9. At this time there is no error checking

accomplished in GLAD. All the error checking is done by the MBDS side; should an

error occur, an error box will appear with a description of the error. A user can then just

correct his query and resend the message. After the query is sent an "Awaiting Results

from MBDS ..." dialog box will appear to let the user know that their query was sent,

see figure 4.10. The results of the query will be displayed in the Browser Window, see

figure 4.11.

47

idtRscribe Query lemplates QUJIT

F1 Help

S2WFIRSTU[IHSERT((TEWEnployee),(HANE,Kardi>,<Age, +27> ,(SALARY .99131> .<PHONE ,7391>) J

Figure 4.9 The Send Query option of QueryWindow

.1 OEM 1"1 o

I Edit Describe Query Lemplates QlUITIF1 Help

028FRSTFINSRTM MP.EplNAME ,Nardi> (Age, +

Please Wait

Figure 4.10 Awaiting Results from MBDS

48

Edit Describe fluery Ieop1ates DJUIT[F1 Help

U2SFIRSTU[ INSERT(<TEHPEmployee>(?WAEardi,(Age, +27> .<SALARY,99331>,<PHSIE.7391>)J

Plor. Hodifi, Quit [Fl Help

.0 +; N ew Inserted...s 28 25606 x1224 record for Mardi

troud 27 6500 x3579ALPOle 32 3618 x1987vypson 26 25666 X4899

rd, 27 9906 x7391urnor 25 23606 x4719

34 12600 x1943Graw 32 66000 x7654

s 45 29000 x2987Gunther 34 92000 X2391

+Jonez 55 130000 x1111Williams 34 29000 x3691Smith 46 77000 x7683runr 41 34000 x519Snolrich 42 78000 x6734

lrk 56 45000 x1967

Figure 4.11 The Results displayed in the Browse Window

fHelp

This option at present only displays a dialog box that gives a brief explanation

of the use of the QueryWindow. In the future, this will be connected to the on-line help

that was done by a previous student in the future. Figure 4.12 shows the Help option as

it exists at the present time.

g. Quit

The Quit option allows the user to close the QueryWindow and all the other

windows that were created during its use. This option returns us back to the DMWindow

where we originally called QueryWindow.

D. SAMPLE SESSION

1. Starting GLAD to receiving Results

49

.lend Query Edit Rescribe Querg lemplates RIUIT

This program demonstrates simple ABDLqueries to a NDS back-endFor a example of each type of query,look under the template's menu Itemand select the specific query.

Figure 4.12 The HELP option of QueryWindow

The following is a sample session of GLAD with a sample MBDS database and

the QueryWindow extension. At each level of interaction, the interface window will be

described. This demonstration will enter GLAD at the beginning and walk a user

through to the point where a query has been sent to MBDS and the results have returned.

a. GLAD Top-Level Window

The GLAD Top-Level Window is the starting point for all transactions. Figure

4.13 shows the GLAD Top-Level Window, from this window a user can create, modify,

open or remove a database. Since GLAD was developed under the Actor environment,

the use of a mouse is required for most operations. Each of the menu options available at

this level will be discussed briefly.

50

Create edift Open Remove quit F1 Help

Figure 4.13 GLAD Top-Level Window

The options available under GLAD Top-Level Window are:

* Create - Allows the user to create a new GLAD database.

* Modify - Allows the user to modify an existing database schema.

* Open - Allows the user to open a database for display and modification.

* Remove - Allows the user to delete an existing database from the system.

To begin our session, we select the Open menu option. By placing the mouse arrow on

the word Open and double clicking the left mouse button, a dialog box is displayed, see

figure 4.14. In this dialog box is a listing of all the databases that exist in the system.

Here, instead of a menu, the user's options are displayed as buttons to the right of the

database listing. Should there be more databases than can fit in the window, a scroll bar

allows the user to move up and down the list. To open a specific database, a user has two

options. The first is to point to the desired database and, as before, double click the left

51

mouse button. Or the user can point at the database's name, click once, then point to the

button that reads OPEN, and click once there. This type of feature, which allows the

user to do the same operation in many different ways, is used throughout the GLAD

environment. It makes it easy for the experienced user as well as the beginner to quickly

navigate themselves through the system.

Create I'odlfv Open Reprove Quit Fl Help

GLAD Databases

aesr PiannIns

::S Lab Equpnt 2r~Pine UajLev Furnirure Co.Test ConneoIon 0UniversirV Database

Figure 4.14 Database Selection Dialog Box

For this session we will select MBDS First. Notice that MBDS First is in the

white letters on a black background, (this is called high-lighted) showing that the item

has been selected. As mentioned above, to select an item point the mouse cursor on it

and click the left mouse button once. All the MBDS databases have the prefix MBDS

prior to their name. When a MBDS database is opened, the socket interface must be set

up between GLAD and MBDS. Once both sockets are set up, GLAD sends a request to

MBDS to open the database, in this case the First database. After MBDS acknowledges

that the database is opened, then GLAD displays the data manipulation window

(DMWindow) for this database using a locally stored database schema file. A further

52

improvement will not require the database schema to be stored locally but it would be

sent from MBDS.

b. Data Manipulation Window (DMWbidow)

The DMWindow displays the objects of the database, represented as

rectangular boxes with the object's name in the center of each box. Figure 4.15 shows an

Create Modify Open Remve Quit F1 Help

DOeorlbe Expencl L iStl~embers Chang*e Query

ShowConnectlon Quit F eA

Figure 4.15 The Data Manipulation Window (DMWindow)

example of a DMWindow with our First database. The menu options for the

DMWindow are:

* Describe - Allows the user to display the attributes of the selected objects.Figure 4.16 shows an example with Employee as the selected object.

0 Expand - Allows the user to display sub-classes of the selected object.

* ListMembers - Allows the user to display and modify the object's data usingan all-at-once(Browse) or one member(Display) at a time. Figure 4.17 showsan example of both. The BROWSE window shows all the data for Employeewhile the DISPLAY shows one record, in this case, Jones.

* Change - not implemented at this time.

53

" Query - Allows the user to query MBDS databases using ABDL queries.

When selected it calls up the QueryWindow, see later section for more details.

" ShowConnection - not implemented at this time.

c. List Member Window

This window displays all the records of the database object. Here again the

scroll bars enable the user to access portions of the database which do not fit in the

Create Modify Open Rnove Quit F1 Help

OeorLbe Expand Llst oes Chang* u e r.V I

Salary at gPhone t String

Figure 4.16 DMWindow's DESCRIBE option on Employee

window. Figure 4.17 shows the records of the Employee object. If a user wants to view

an individual record in detail, he can select the More option after selecting that specific

record. This will call the Display One Window.

d Display One Window

Figure 4.17 also shows a Display One Window which, as described above,

enables a user to see all the information contained in a specific record.

In the Display One Window, the user has the following options:

* Add - add a new record to the selected object.

54

* Delete - remove this selected record.

0 Modify - change the data in this selected record.

Create Nodif, Open Remove Quit F1 Help

II Next 11oTo all Qui~t Nr Modlfv Quit Fl Help

M. F1Hl in 39 10808 x2345Jone 23 351100 x1234

"RM goud 27 65369 x3578[Jaoes 1pole 32 36980 x1987

Vnpson 26 25600 x4589rdi 27 99699 x7391

Aurner 25 2300 x471934 1200 x1943

Draw 32 66100 x7654eg 45 29006 x2997

Salary 2 9

130000 1aes 34 29000 x3691Ksith 46 77000 x7683

Phone runer 41 3409 x5109xi11i _p olarioh 42 789 0 x6734

Figure 4.17 GLAD Browse and Display Windows

* Prey - move one record up in the list.

* Next - move one record down in the list.

* Goto - Allows the user to move to the first, last, or Ith record.

" All - Opens a BROWSE or List Member Window.

e. QueryWindow

If the user desires to query the MBDS database, they would select the Query

option in the data manipulation window menu. Figure 4.18 shows the selection and the

results of the selection. After selecting Query, the query window is displayed. For a

more detailed discussion on each of the menu options, please refer to the previous section

on QueryWindow. For this session, we will skip over some of the details. The next step

55

is to create our query. What we want to do is insert a new record for Nardi in the

selected object, Employee. After selecting the Query option of QueryWindow, we fill in

the details of the record for Nardi, NAME, AGE, SALARY, and PHONE. If we had

Create NodiFv Open Remove Quit I F1 Help

Demribe Expand List~ebtrs ChangeShow~eaneotien QuitFlHp

Send Query Edit ResCribe Query Iemplates 2lUITF1 Help

rMFigure 4.18 Initiating a Query from DMWindow

forgotten the attributes of Employee, we could select the Describe option and they would

be displayed exactly as they are displayed in the DMWindow. If by chance, a more

detailed template for the insert query is needed, we could select Insert from the pop-up

menu of the Templates option of QueryWindow. Now that we have the query correct,

see figure 4.19, we are ready to send it to the backend, MBDS. To do this we select the

option Send Query, notice that it is high-lighted. After we select Send Query, the query

is sent to the MBDS via the socket interfaces. Figure 4.20 shows the message that the

query has been sent to MBDS and that GLAD is waiting for the results. Should the

query have an error in it, a message from MBDS will tell the user the type of error. The

user can then edit the query in the QueryWindow to correct any mistakes and then resend

56

the query. When MBDS has completed the query, it will send the results back to GLAD

where they will be displayed for the user. Figure 4.21 shows the results of our insertion

Create hodify Open Reove Quit F1 Help

-I..Describe Expand Listembers Change QueryShowconnection qi

[dit Describe Query lemplates QI[T

IF1 Help

i 2FIRSTe[IHSERT((TEHP,Exploee>,(HAHE,Hard>,(Age,2> ,(SALARY ,99Sfl>,(PHOIE,7391))]

m m 4' 4 --

Figure 4.19 Query ready to be sent to MBDS from QueryWindow

of Nardi into the Employee record. The Browse window is automatically presented for

Insert, Delete, and Update for the user's convenience.

This interface is a vast improvement over the present MBDS interface. One of

the ways to further improve the GLAD interface is to allow the user to insert, delete, and

update from the Display One Window. This is not implemented at the present time.

57

Create Modify Open Renove Suit Fl Help

Describe Expand Listflebers Change QunerySheuConnetien Quit F1 Help

Results from

Please Wait

no@Figure 4.20 Awaiting Results from MBDS

Crat nof OpnRmoeQi

S2@FIRST@[IHSERT(TEP Emploee>.(HAE,ardi>,<Aqe,

I & A

ogn 3r 1660 2345

vypson 26 25600 x45:9* rdi 27 99900 x7391

Turner 25 23::S0 x47192u 4 1268 K1943

_____________ lark 56 45600 X1067 4,

Figure 4.21 The Results of the Query displayed in the BROWSE Window

58

V. CONCLUSIONS

A. A REVIEW OF THE RESEARCH

The goal of the research conducted in this thesis was to provide an extension to

GLAD that would provide the user with an ABDL Query ability to access the database

on the MBDS backend. The graphical interface provides an user friendly system that any

user at any level of experience could use immediately. The QueryWindow allows the

user to use any of the five ABDL queries. This window also with some minor

modifications will allow any type of queries, SQL or GLAD's own query language when

it is developed.

B. FUTURE ENHANCEMENTS

Since the GLAD system is still evolving, there are many possible enhancements to

the present system which include, but are certainly not limited, to the following:

* Improved Socket Interface - While a socket interface presently exists, thereis room for improvement. We would like the socket interface to be an integralpart of the GLAD system instead of its present configuration. Anotherimprovement is to allow the user to remotely initiate the MBDS system fromthe individual front-ends. Also needed is the ability for the MBDS systemonce opened from GLAD, to send the Database's schema to the front-endinstead of having thL front-end constantly storing them.

0 Expand the Query Language Ability - With the Navy's recent push towardsthe "paperless ship" concept, the need for the ability to generate and processthe multitude of Database Models required to maintain a large navy becomesimperative. First there is a need for a GLAD query language for GLADdefined databases. Secondly, the development of a SQL query ability.

0 Digital Manuals - One of the major goals of the "paperless ship" is to takeadvantage of computers' ability to store, access and assimilate data. Anaddition to GLAD should be a hypertext ability. This would greatly reducethe amount, weight and storage area required by the vast number of technical

59

and maintenance manuals required by each ship. It would also decrease theman-hours required to access the necessary data.

" Integrated Package - The Navy needs to develop under a user friendlyinterface system which every user can use. GLAD and MS-Windows providesuch an environment. The package should handle word processing, AMI,databases, GLAD, and graphics, PCPaint.

" SNAP 11 Backend Prototype - The present system shows the ability andbeauty of GLAD as a front-end interface for a backend. Since GLAD wasdeveloped on the Zenith 248 computer, it can be used in the Fleet today notten years from now. The next goal should be linking GLAD to a SNAP IImini-computer and develop querying ability to the data already out in thefleet.

C. DISCUSSION AND BENEFITS OF THE RESEARCH

GLAD offers user friendly environment for the novice as well as the experienced

user. The Navy has thousands of Zenith 248s in service, and a user group whose

expertise varies from one end of the spectrum to the other. The vast majority have had

no background what-so-ever in computers. It takes a considerable amount of time to

train these individuals to perform specific tasks. Right now they are required to learn a

different system for each major operation, one for databases, one for word processing

and another for supply requisitions.

The GLAD and MS-Window environment gives the user one over all system to learn

with many major features carrying over from one application to another. This integrated

package has great potential for both the military and civilian sector. It is just such a

package that has led to the popularity of the Macintosh computers by Apple. The IBM

computers have as much or more power, and the software is as good as the Macintosh but

Macintosh has it all integrated for the user! Replacing all the Zenith 248s and other

computers with Macintosh is not the answer.

60

Prof. Wu has a sister project, ARGOS, being developed on the Macintosh. It is an

outstanding demonstration of the power of a hypertext feature on a PC. Hypertext on

IBM computers is just beginning to match the ease and power of the Macintosh.

Although this sister project named ARGOS is impressive, it unfortunately relies on

Macintosh computers which are not readily available to the fleet today. GLAD is an

attempt to mirror the progress made in the ARGOS project; and in area of database needs

we believe we have surpasses ARGOS. GLAD is the solution today and tomorrow.

61

APPENDIX A. ACTOR .RC RESOURCE FILE

The following listings are the Actor code that was either created or modified for the

implementation of this thesis.

;Resource Script File for Actor version 1.2

*include "STYLE.h"#include "actor.h"#include "track.h"#include "demos.h"#include "glad.h"

work ICON work.icoBrowser ICON browser.icoFile Window ICON filewind.icoInspector ICON inspecticocube DATA cube.datActor BITMAP actor.bmnp

gladicon ICON glad.icosocketicon ICON sockets.ico

GladTopMenu MENUBEGIN

MENUITEM "Create", 1MENUITEM "Modify', 2MENUITEM "Open", 3MENUITEM "Remove", 4MENUITEM "Quit", 6MENUITEMA 'NaP Help", 5, HELP

END

GladTopMenu ACCELERATORSBEGINVKF 1, 5, VIRTKEYVKDELETE, EDITCLEAR, VIRTKEYVKDELETE, EDITCUT, VIRTKEY, SHIFTVKINSERT, EDIT-COPY, VIRTKEY, CONTROL

62

VKINSERT, EDITPASTE, VIRTKEY, SHIFT

END

QueryGlad MENUBEGIN

MENUITEM "&Send Query",21POPUP "&Edit"BEGINMENUITEM "Cu&tzShift+Del", EDIL-CUTMENUITEM "&Copy\tCtrl+lns", EDIT_COPYMENUITEM "&PasteVzShift+Ins", EDITPASTEMENUITEM "C&lea?\tDel", EDITCLEAR

MENUITEM SEPARATORMENUITEM "Select &AlNtCtrl+A", EDITSELALLEND

MENUITEM "&Describe", 12POPUP "Q&uery"

BEGINMENUITEM "&Insert", 22MENUITEM "&Update", 24MENUITEM "&Delete", 25

* MENUITEM SEPARATORMENUITEM "&Retrieve", 23MENUITEM "Retrieve &Common", 26END

POPUP "&Templates"BEGIN

MENUITEM "&Insert...... 32MENUITEM "&Update...... 34MENUITEM "&Delete...... 35MOENUITEM SEPARATORMENUITEM "&Retrieve...... 33MENUITEM "Retrieve &Common...... 36

END

MENUITM "&QUIT",lIlMENUITEM "\aFl Help", 1O,Help

END)

63

QuciyGlad ACCELERATORSBEGIN

VKYF1, 10, VIRTKY

VKNSERT, EDIT-PASTE, VIRTKEYVKDELETE, EDIT-CUT, VIRTKEYVKSUBTRACT, EDIT-CUT, VIRTKEYVK&ADD, EDiT_-COPY, VIRTKEY

VK-LEFT, VK-LEFT, VIRTKEYVKJJP, VKJJP, VIRTKEYVK-RIGHT, VKRIGHT, VIRTKEYVKJ)OWN, VK_-DOWN, VIRTKEY

"Aa", EDIL-SELALL"1AS", 21"1AZ", BR-ZOOM

VKJTAB, EDIT_-TAB, VIRTKEYVK-PRIOR, EDIT_-PRIOR, VIRTKEYVK-NEXT, EDITNEXT, VIRTKEYVK -HOME, EDITHOME, VIRTKEYVK-END, EDITEND, VIRTKEY

VKDELETE, EDITCUT, VIRTKEY, SHIFTVKINSERT, EDIT-COPY, VIRTKEY, CONTROLVKINSERT, EDIT-PASTE, VIRTKEY, SHIFT

END

GladDmlJMenu MENUBEGIN

MENUITEM "Describe", 1MENUITEM "Expand", 2POPUP "ListMembers"BEGIN

MENUITEM "All at Once", 3MENUITEM "One by One", 4ENDPOPUP "Change"BEGIN

MENUITEM "Add data", 5MENUITEM "Delete data",6

64

MENUITEM "Modify data", 7ENDMENUrEM "Query", 8MENUITEM "ShowConnection", 9MENU1TEM "Quit", 11MENU1TEM "\aFl Help", 10,HELP

END

GladDdlMenu MENUBEGIN

MENUITEM "Save", IMENUITEM "Define", 2MENUITEM "Attribute", 3MENUITEM "Expand", 4MENUITEM "Delete", 5MENUITEM "Quit", 7MENUITEM "\aFl Help", 6,HELP

END

GladLMMenu MENUBEGIN

MENUITEM "More", IMENUITEM "Modify", 2MENUITEM "Quit", 4MENUITEM "\aFl Help", 3,HELP

END

GladOMMenu MENUBEGINMENUTEM "Add", 1MENUITEM "Delete", 2MENUITEM "Modify", 3MENUITEM "Prev", 4MENUITEM "Next", 5POPUP "GoTo"BEGINMENUITEM "First", 6MENUITEM "Last", 7MENUITEM "I th", 8

ENDMENUITEM "All", 9

65

MENUITEM "Quit", I IMENUITEM 'aF1 Help", 10IELP

END

GladCOMenu MENUBEGINMENUrIEM "Quit", 1

END

ABOUTGLAD DIALOG 90,34,122,80STYLE WSDLGFRAME I WSPOPUPBEGIN

CTEXT "GLAD Version 0.03", -1, 23,12,72,11, WSCHILDC EXT "Naval Postgraduate School", -1, 8,25,105,10,WS CHILDCTEXT "Dept of Computer Science", -1, 9,37,100,11, WS CHILDICON "gladicon",-1,26,50,16,16, WSCHILDDEFPUSHBUTTON "START", IDOK, 70,58,39,14, WS-CHILD

END

DATAWAIT DIALOG LOADONCALL MOVEABLE DISCARDABLE 12, 18, 98,74

STYLE WSDLGFRAME I WSPOPUPBEGIN

CONTROL "socketicon", -1, "static", SS ICON I WS CHILD, 13, 20, 16, 26CONTROL "Awaiting Results from MBDS... Please Wait", 101, "static",

SSCENTER I WSCHILD, 36, 19, 58, 33END

OPNDBLIST DIALOG LOADONCALL MOVEABLE DISCARDABLE 70, 23,166, 102

CAPTION "GLAD Databases"STYLE WSDLGFRAME I WSPOPUPBEGIN

CONTROL "" DBLB, "listbox", LBSNOTIFY I LBSSORT ILBS-STANDARD IWSBORDER I WSVSCROLL I WSCHILD, 5,16, 110,82

CONTROL "OPEN" DEFBUT ON, "button", BS-DEFPUSHBUT7ON IWSTABSTOPI

WSCHILD, 125, 17, 33, 13CONTROL "ABOUT" ABOUT-DB, "button", BSPUSHBUTTrON I

WSTABSTOPI

66

WSCHILD, 125,41,33, 13CONTROL "HELP" HELPLB, "button", BS_PUSHBUTTON I WS_TABSTOP I

WSCHILD,126,62,32, 13

CONTROL "CANCEL" 2, "button", BS_PUSHBUITON I WS_TABSTOP IWSCHILD, 125, 82,

33, 13CONTROL "GLAD Databases" -1, "static", SSCENTER I WS_CHILD, 17, 4,

83, 10END

RMVDBLIST DIALOG LOADONCALL MOVEABLE DISCARDABLE 70, 23,166, 102

CAPTION "GLAD Databases"STYLE WSDLGFRAME I WSPOPUPBEGIN

CONTROL "" DBLB, "listbox", LBSNOTIFY I LBSSORT ILBSSTANDARD I

WSBORDER I WSVSCROLL I WSCHILD, 5,16,115, 82CONTROL "REMOVE" DEFBUT1ON, "button", BSDEFPUSHBUTTON I

WSTABSTOPIWSCHILD, 126, 16, 33, 13

CONTROL "CANCEL" 2, "button", BS_PUSHBUT'ON I WSTABSTOP IWSCHILD, 126,81,

33, 13CONTROL "ABOUT" ABOUTDB, "button", BS_PUSHBUTTON I

WSTABSTOPIWSCHILD, 126, 39, 33, 13

CONTROL "HELP" HELPLB, "button", BSPUSHBUTTON I WSTABSTOP IWSCHILD,

127, 61, 32, 13CONTROL "SELECT the one to be REMOVED" -1, "static", SSCENTER I

WSCHILD, 0, 3,124, 10END

DEFOBJ DIALOG LOADONCALL MOVEABLE DISCARDABLE 23, 21,136,98CAPTION "OBJECT DEFINITION"STYLE WSBORDER I WSCAPTION I WSDLGFRAME I WSPOPUPBEGIN

CONTROL "Enter Object Name:" 0, "static", SS LEFT I WSCHILD, 8, 5, 74, 10CONTROL "" OBJNAME, "edit", ESLEFT I WSBORDER I WSTABSTOP I

WSCHILD,

67

8, 16, 117, 12CONTROL "Atomic" ATOMIC, "button", BS-RADIOBUITON I WS_ GROUP I

WSTABSTOPI WSQIIL.D, 25,44,40, 12

CONTROL "Nested" NESTED, "button", BSRADIOBU1TON I WS_TABSTOPI WSCHILD,

70,44,41,12CONTROL "Nesting Level" LEVEL, "button", BSGROUPBOX I

WSTABSTOP IWS-.C.HILD, 20, 31, 93, 30

CONTROL "Accept" 11)0K, "button", BSJ'USHBUT1'ON I WS_2GROUP IWSTABSTOPI

WS-CHILD, 17,70,42, 14CONTROL "Cancel" IDCANCEL, "button", BSPUSHBUTI'ON I

WSTABSTOPIWS-CHILD, 76, 71, 42, 14END

ATIRIB DIALOG LOADONCALL MOVEABLE DISCARDABLE 11, 18, 208,216

STYLE WSDLGFRAME I WSPOPUPBEGIN

CONTROL "Attribute Name:" DT _CENTER, "static", SSLEFT IWS_CHILD, 6, 18,64, 12

CONTROL "Attribute Type:" 5, "static", SS-LEFr I WSCHILD, 6, 54, 79,

12 CONTROL "Length of field:" 15, "static", SSLEFT I WS_CHILD, 6, 90, 86,10

WS-ABSOPICONTROL "". ATIT&NAME, "edit", ES-LEFr I WSBORDER I

WS-CHILD, 5, 30, 105, 15CONTROL "" ATTRTYPE, "edit", ESLEFT I WSBORDER I

WSTABSTOPIWS-CHILD, 5, 67, 105, 15

CONTROL .." AITRLENGTH, "edit", ESLEFT I WSBORDER IWSTABSTOPI

WS-CHILD, 5, 102, 105, 16

CONTROL "" ATR...LIST, "listbox", LBSNOTIFY I LBSSORT ILBSSTANDARD I

WSBORDER I WSVSCROLL I WSCHILD, 5, 126, 106, 82CONTROL "Add" IDOK, "button", BS2PUSHBUTTON I WSTABSTOP I

WSCHILD, 138,42, 44, 14

68

CONTROL "Delete" AT'R_DELETE, "button", BSPUSHBUTrON IWSTABSTOPI

WSCHILD, 138,72,44, 14CONTROL 'Type List" TYPELIST, "button", BSPUSHBUTTON I

WSTABSTOP IWSCHILD, 138, 102,44, 15

CONTROL "Quit" IDCANCEL, "button", BSPUSHBU'TON IWSTABSTOPI

WSCHILD, 139, 132,44, 14CONTROL "Attributes for object" 16, "static", SS_LEFT I WS_CHILD, 29,

5,86,8CONTROL .... OBLNAME, "edit", ES_LEFT I WSTABSTOP I

WSCHILD, 118, 5,74, 12END

ATTRLIST DIALOG LOADONCALL MOVEABLE DISCARDABLE 11, 18, 122,122

STYLE WSDLGFRAME I WSPOPUPBEGIN

CONTROL "" TYPELIST, "listbox", LBSNOTIFY I LBSSORT ILBSSTANDARD I

WSBORDER I WSVSCROLL I WSCHILD, 7,6, 105,74CONTROL "Accept" IDOK, "button", BSPUSHBUTTON I WSTABSTOP I

WS_CHILD, 18,90, 33, 14

CONTROL "Cancel" IDCANCEL, "button", BSPUSHBUTTON IWSTABSTOPI

WSCHILD, 68, 90, 29, 14END

STRINGTABLEBEGIN

IDSNAME, "Actor"IDSAPP, "ACTOR.IMA"

I , "Divide by 0"2, "Index is out of bounds"5, "Non-integer index argument to primitive"7 , "invalid size sent to new primitive"10, "Out of static memory"16, "Wrong number of block arguments"19, "Break occurred"

69

20, 'Too large for Char conversion"21, "Wrong number of arguments"22, "Wrong argument type to primitive"27, "Bad range to copyFrom primitive"32, "Can't convert to Windows short argument"33, "Long is too large for Int conversion"36, "Bad range input to munger primitive"40, "Primitive receiver is nil"

syntaxError, "<<< Syntax error"eosError, "<<< Premature end of input"sLitError, "Unterminated String literal"undefError, "<<< Undefined variable name"litSymError, "<<< Incoreect literal symbol format"curClassError, "No current class in Compiler"ancestError, "is not an ancestor of"inheritError, "is not a function in "

litNumError, "<<< Improper literal number format"wNameError, "<<< No such MS-Windows routine"wSynError, "<<< Improper MS-Windows call syntax"litArrayError, "<<< Improper literal array syntax"litArrayOvflError, "<<< Literal array is too large"defineError, "<<< Improper #define format"litRectError, "<<< Improper literal rectangle format"infixError, "<<< Not a valid infix expression"commentError, "<<< Unterminated comment"registerError, "Couldn't register class"menuError, "Couldn't load menu"wCreateError, "CoulCn't create window"emptyError, "Empty collection"elemNotFndError, "Element not found in collection"dosError, "reported DOS error#"rangeError, "Index is out of bounds"undefCharError, "<<< Undefined"ivarsError, "Structs can't have instance variables"handleError, "No handle obtained for object"

wCallArgsError, "Wrong number of args in Windows Call"numTempsError, "Total arguments and locals can't exceed 15"

Used for results of checkError52, ", File not found"53, ", Path not found"54, ", No file handle available; all in use"

70

55, ", Access denied"56, ", Invalid file handle"58, ", Insufficient memory"65, ", Invalid drive specification"

150, "Attempted to move freed object:"151, "Adding to scavenger list:"152, "Dynamic memory is full."153, "Free list is corrupted."154, "Scavenge list is full."155, "Out of object pointers."156, "S..apshot write failed."157, "Snapshot load failed."158, "Not enough memory to run Actor."159, "Not enough dynamic for static gc."160, "Actor Display"161, "Requires higher static setting."162, "Requires higher dynamic setting."163, "ActorxAE 1.2"164, "Windows/Actor stack overflowed165, "Windows/Actor stack underflowed"166, "Actor stack overflowed"

167, "Corrupted object memory"168, "Actor symbol table is full"

Miscellaneous Actor system strings. DO NOT MODIFY!300, "Class Definition Error"301, "cannot be redefined."302, "Recompile these classes?"303, "Delete these classes?"304, "Class Name Error"305, "already exists. Use About Class dialog."306, "exists. Should it be overwritteii?"307, "File Conflict"308, "File Renamed"309, "Old work has .BAK extension."310, " source is unavailable."311, "Class Source File Error"312, " file not found in"313, "Actor Error"314, "FileWindow is not loaded"315, "File Editor: Untitled"316, "File Edit Error"317, "The file is too large."

71

318, "Discard changes?"319, "Save text as:"320, "workmenu"321, "Actor Workspace"322, "** Recompile classes; remove existing instances *"323, "Untitled"324, "browmenu"325, "Browser"326, "/* class comment *r'327, "class definition *1"328, "debugmenu"329, "Debugger: "

330, "Can't resume!"331, "classes\V'332, "work\V333, "backup\V334, "EditWindow"335, "File Error"336, "FileEditMenu"337, "File Editor"338, "Breakpoint"339, " bytes reclaimed."340, " bytes available."341, "Syntax Error"342, "Recursive error:"343, "Actor Error: "344, "Not understood:"345, "Recursive message send failure:"346, "doesn't understand:"347, "Compilation Error"348, " is undefined. Should it become a global variable?"349, "Undefined Name"350, "Bytes Free"351, "Static: "352, " MS-Windows:"353, "Missing BACKUP directory for source."354, "Write the Image to this file:"355, "Load Error"356, "You must assign LoadFiles before using loado."357, "Warning!"358, "Dynamic memory is getting low."359, "Run Application"360, "Application file name:"361, "Editor:

72

362, "Inspector:363, "Browser:"364, "workedit"365, "Senders"366, "Implementors"367, "References"368, "Global References"369, "inspmenu"370, "Do you really wish to close this window?"371, "MS-Windows function"372, " takes "373, " argument(s)."374, " (CLASS)"375," ; can use " (OBJECT)" if you want this label for object methods

in the Browser376, "Stack frames above recompiled method are now invalid."377, "You must exit Actor before exiting Windows"378, " Dynamic:

template stringsTEMP DO, " do(receiver, fusing(elem) );

* TEMPEF, " if cond then stmtList; endif;"TEMPJIFEL, " if cond then stmtList; else stnnList; endif;,"TEMPBLOCK, " I using(elem) ) "TEMP-CASE, "select case cond is stmtList;endCase case cond is stmtList;endCase

endSelect;"TEMP-LOOP, "loop while cond begin stmtList; endLoop;"TEMPNMETH, "1* comment */ Def method(self) (I

END

Actor ACCELERATORSBEGINVKINSERT, EDITPASTE, VIRTKEYVKDELETE, EDIT-CUT, VIRTKEYVKSUBTRACT, EDIT-CUT, VIRTKEYVKADD, EDITCOPY, VIRTKEY

VKLEFT, VK-LEFT, VIRTKEYVKUP, VK-UP, VIRTKEYVK_-RIGHT, VKRIGHT, VIRTKEYVKDOWN, VKDOWN, VIRTKEY

"Aa", EDIT -SELALL"Ar", BR-REFORM

73

"fAZ"I BR_ZOOM

VKAB, EDITTAB, VIRTKEYVK-ROR, EDIT_-PRIOR, VIRTKEYVK...NEXT, EDIT_-NEXT, VIRTKEYVK..HOME, EDITHOMIE, VIRTKEYVK-END, EDITEND, VIRTKEY

VKDELETE, EDIT-CUT, VIRTKEY, SHEIFTVKINSERT, EDITILCOPY, VIRTKEY, CONTROLVKINSERT, EDIT-PASTE, VIRTKEY, SHFT

END

ABOUT-BOX DIALOG DISCARDABLE 59,79,151,128STYLE WSPOPUP I WSDLGFRAMEBEGIN

CTEXT "ActorxAE 1.2" -1, 1, 12, 147, 10CTEXT "CopyrightV\A9 1986-1988" -1, 1, 28, 147, 10CTEXT "The Whitewater Group, Inc." -1, 1, 39, 147, 10CTEXT "All rights reserved." -1, 1, 50, 147, 10ICON "work" 5, 24, 98, 13, 17ICON "browser" 6, 114, 98, 13, 17CTEXT "Portions CopyrightV\A9 1983-1988", -1, 1, 68, 147, 10CTEXT "Microsoft Corporation", -1, 1, 79, 147, 10DEFPUSHBU'ITON "&Ok" 1)0K, 57, 99, 32, 14, WS-GROUP

END

INPUTBOX DIALOG DISCARDABLE 77, 94, 165,71STYLE WSBORDER I WSCAPTION I WSDLGFRAME I WSPOPUPBEGIN

EDITEXT FILE-EDIT, 10, 32, 138, 12, WSBORDER I WSCHILD IWSTABSTOP IESAUTOHSCROLL

LTEXT "", INPUTMSG, 11, 5, 143, 18, WS...CHLLDDEFPUSHBUTITON "&Ok" IDOK, 32, 50, 32, 14, WS...CHILDPUSHBUT7ON "&Cancel" IDCANCEL, 99, 50, 32, 14, WS_CHILD

END

ERR_-BOX DIALOG DISCARDABLE 48,32,210,85STYLE WSPOPUP I WSCAPTIlONCAPTION "Error Dialog"BEGIN

DEFPUSHBUTTON "&Ok", IDOK, 172, 8, 28, 14, WS-GROUPPUSHBUTTON "&Debug", IDYES, 172, 28, 28, 14, WS-..GROUPLISTBOX ERR_ LB, 4, 8, 160,70

74

END

DWBOX DIALOG DISCARDABLE 27, 27,201,105STYLE WS_ DLGFRAME I WSPOPUPBEGIN

LTEXT"The text in theBrowser edit window has been" 2, 10, 11, 180, 10LTEXT "changed. Accept or Cut to Clipboard?" 3, 10, 24, 150, 10PUSHBUTTON "&Accept", DW_.ACC, 10, 47,75, 14, WS__XHILDPUSHBU'1TON "Cut to CMipboard", DW-CTC, 10, 74,75, 14, WS CHILDDEFPUSHBUTTON "A&bandon", DW....ABA, 110, 47,75,14, WSCHILDPUSHBUTT'ON "&Cancel", IDCANCEL, 110, 74,75, 14, WS_CHILD

END

FRACTALBOX DIALOG DISCARDABLE 90,69,160,85CAPTION "Fractal Controls"STYLE WSBORDER I WSCAPTION I WSDLGFRAME I WSPOPUPBEGIN

CONTROL "Type" -1, "button", BSGROUPBOX I WSCHILD, 8, 9, 66, 50CONTROL "&Koch" II)_KOCH, "button", BS-RADIOBUTONI

WSTABSTOP IWS_-CHILD, 12,20,28, 12CONTROL "&Square Koch" ID-SQKOCH, "button", BS_RADIOBUTFrON I

WSCHILD, 12, 31, 56, 12CONTROL "&Peano" ID_PEANO, "button", BS-RADIOBIYITON I

WSCHILD, 12,42,33,12CONTROL "Order" -1, "button", BS-GROUPBOX I WSGROUP I WSCHILD,

86, 9, 30, 70CONTROL "&I" IDORDER 1, "button", BS...RADIOBU'TTON I WSCHILD,

94, 20, 16, 12CONTROL "&2" IDORDER2, "button", BS-RADIOBUTTON I WSCHILD,

94, 31, 16, 12CONTROL "&3" II)_ORDER3, "button", BSRADIOBUTTON I WSTABSTOP

I WSCHILD, 94,43,16,12CONTROL "&4" II)_ORDER4, "button", BS-RADIOBUTTON I WSCHILD,

94, 54, 16, 12CONTROL "&5F IDORDERS, "button", BS-RADIOBUTrON I WSCHILD,

94, 65, 16, 12CONTROL "50" IDLENGTH, "edit", ES_ LEFT I WSBORDER IWS_GROUP I

WSTABSTOP I WS- CHILD, 40, 67, 34, 12CONTROL "Length: " -1, "static", 55 LEFT I WS_-CHILD, 8, 69, 28, 8CONTROL "&OK" IDOK, "button", BS_DEFPUSHBUTTON I WSTABSTOP I

WSCHILD, 124, 26, 28,14CONTROL "&Cancel" IDCANCEL, "button", BSPUSHBUT7ON I

WSTABSTOP I WSCHILD, 124, 53, 28, 14ENID

75

DCL_BOX DIALOG DISCARDABLE 44,25,234,134STYLE WSDLGFRAME I WSPOPUPBEGIN

PUSHBUTTON "&Delete Files" DCLDEL, 38, 97, 60, 14, WS_CHILDPUSHBUTTON "Save &Files" DCL_- SAV, 38, 113,60, 14, WS_CHILDDEFPUSHBU'ITON "&Snapshot" IDOK, 136, 97, 60, 14, WSCHILDPUSHBUTTON "&Cancel" IDCANCEL, 136,113,60, 14, WS_CHILDLTEXT "You have modified the image. The modified source" 9, 12, 5, 204, 10LTEXT "files for the following classes are located in the" 2, 12, 16, 205, 10LTEXT "WORK directory." 2, 12, 27, 63, 10LTEXT .... DCLLIST, 11, 43, 212, 22, WSBORDER I WSCHILDLTEXT "Before quitting, do you want to take a snapshot, or" 5, 13, 69, 208, 10LTEXT "save the modified source files in the WORK directory?" 8, 12, 80, 212,

10END

FILEBOX DIALOG DISCARDABLE 27, 23, 192, 105STYLE WSDLGFRAME I WSPOPUPBEGIN

EDITITEXT FILEEDIT, 54,5,127, 12, ESAUTOHSCROLL I WSCHILDCONTROL .... FILELB, "listbox", LBS_STANDARD I WSTABSTOP I

WSCHILD, 10, 39, 99, 57DEFPUSHBUTTON "&Open", IDOK, 135, 47, 32, 15, WSCHILDPUSHBUTTON "&Cancel", IDCANCEL, 135, 73, 32, 15, WS_CHILDCONTROL "File name:" 3, "static", SSLEFT I WSCHILD, 10, 7, 41, 11CONTROL .... FILEDIR, "static", SSLEFT I WS_CHILD, 10, 23, 176, 11

END

CLASSBOX DIALOG DISCARDABLE 36,48,270,160STYLE WSPOPUP I WSCAPTIONCAPTION "Class Definition"

BEGINLTEXT "Name:", CLASS_LNAME, 4, 2, 20, 14EDITTEXT CLASSNAME, 4, 12, 100, 14LTEXT "Ancestor:", CLASSLANC, 4, 28, 40, 14ED'ITEXT CLASS_ANCEST, 4,38, 100, 14RADIOBUTTON "&Byte", CLASSBYTE, 6, 64, 30, 14RADIOBUTTON "&Word", CLASS_WORD, 40, 64, 30, 14RADIOBUTTON "&Ptr", CLASSPTR, 70, 64, 30, 14GROUPBOX "Format", CLASS_FORM, 4,54, 100, 26CHECKBOX "&Indexed", CLASS_IDX, 4, 82, 40, 14

76

DEFPUSHBUTT'ON "Accept", IDOK, 46, 86,28, 14 ;new default forWindows 2.0

PUSHBUTTON "Cancel", IDCANCEL, 76, 86, 28, 14 ; no longer the defaultLTEXT "Variables:", CLASSLNARS, 108, 2, 50, 14

ED1YTEXT CLASS_VARS, 108, 12, 160, 90,ESAUTO VSCROLLIESMULTILINErWSVSCROLL

LTEXT "Comment:", CLASS.LCOM, 4,96,40, 14EDITE= CLASS_COM, 4, 106, 264, 52,

ESAUTOVSCROLLIESMULTILINEIWSVSCROLLEND

methodbr.rc for lang ext I

MBrowMenu MENUBEGIN

MENUITEM "&Accept!", BRACCEPT

POPUP "&Edit"BEGINMENUITEM "Cu&t\tShift+Del", EDIT-CUTMENUITEM "&Copy\tCtrl+Ins", EDIT-COPYMENUITEM "&Paste\tShift+Ins", EDILPASTEMENUITEM "C&lear", EDIT-CLEARMENUITEM SEPARATORMENUITEM "Select &AlI\zCtr]+A", EDIT_-SELALLMENUITEM "&Reformat\tCtrl+R", BRREFORM

END

MENUITEM "&Doit!", INSPDOlTMENUITEM "&Inspect!", INSP-ISEL

POPUP "&Utility"BEGINMENUITEM "&Implementors", WORKIMPMENUITEM "&Senders", WORKSYMSENDMENUITEM "&Global References", WORKGLOSEND)MENU1TEM "&References", WORKSEND

END

POPUP "&Templates"BEGIN

MENUITEM "&clo', TEMPDOMEN UITEM "&if/then", TEMPIF

77

MENUIEM "if/else", TEMIP-iFELMENUITEM "&block", TEMP_ BLOCKMENjjrTEM "&select/case", TEMP_CAsem*nUITEM "&loop", TEMPLOOPNMNUITEM SEPARATORMENUITEM "&New method", TEMP!-NMTH

ENDEND

demoMenu MENUBEGIN

MENUITEM "&Clear!", DEMOCLEARPOPUP "&Turfle"

BEGINMENUITEM "&Load Demo", DEMOLTURTLOADMENIJITEM SEPARATORMENiJITEM "&Patternm..... DEMOFRACTAL

ENDMENUITEM "T&rack!", DEMOTRACLOADMENUITEM "C&ube!", DEMOCUBELOADMENUITEM "&Graph!", DEMOGRAFLOADMENUITEM "&Fractal!", DEMOFRACLOADPOPUP "&Mandelbrot"

BEGINMENUITEM "Plot& 1V, DEMO_BRT1LOADMENUITEM "Plot&2", DEMOBRT2LOADMENUITEM "Plot&3", DEMOBRT3LOAD

ENDMENUITEM "&Queens!", DEMO QUENLOADMENUITEM "CMassTree!", DEMOTREELOADMENUITEM "&ActorLogo!", DEMOLOGOLOAD

END

track MENUBEGINPOPUP "&Shape"

BEGINMENUITEM "&Clear" , IDDCLEARMENUITEM "&Ellipse" , IDDELLIPsem*nUITEM "&Rectangle", IDDRiECTMENUITEM "&Star" , [DDSTARMENUITEM "&Triangle", IDDTRIANGLE

ENDEND

78

EditMenu MENUBEGIN

POPUP "&Edit"BEGINMENUITEM "Cu&t" EDIT71_CUTMENUITEM "&Copy", EDITCOPYMENUITM "&Paste", EDITPASTEMENUITEM "CMear", EDITCLEAREND

END

DebugMenu MENUBEGIN

MENUITEM "&Accept!", BR-ACCEPTPOPUP "&Edit"

BEGINMENUITEM "Cu&t", EDITCUTMENUITEM "&Copy", EDIT -COPYMENUITEM "&Paste", EDIT-PASTEMENUITEM "CMear", EDrrCLEARMENUITEM SEPARATORMENiJITEM "Select &All", EDITSELALLMENUITEM "&Reforrnat", BRREFORM

ENDMENUITEM "&Doit!", INSPDOITPOPUP "&Inspect"

BEGINMENUITEM "&Temporary", DBGTEMPMENUITEM "&Selection", TNSPISEL

ENDPOPUP "&Utility"BEGIN

MENUITEM "&Implementors", WORK_IMPMENUITEM "&Senders", WORKSYMSENDMENUITEM "&Global References", WORK_GLOSENDMENUITEM "&References", WORKSEND

ENDMIENUITEM "&Resumne!", DBGRES

END

InspMenu MENUBEGIN

POPUP "&Edit"

79

BEGINMENUITEM "Cu&ftShift+Del", EDITCUTMIENUITEM "&Copy\,tCtrl+Ins", EDIL-COPYMENUITEM "&Paste\tShift+Ins", EDIT1_PASTEMENUTM "CMear", EDITCLEAR

END

MENUITEM "&Doit!", INSP...DOITPOPUP "&Inspect"

BEGINMENUITEM "& Variable", INSPWIARMENUITEM "&Key", INSPJKEYMENUITEM "&Selection", INSPISEL

ENDEND

BrowMenu MENUBEGIN

MENUITEM "&Accept!", BR-ACCEPTPOPUP "&Edit"

BEGINMENUITEM "Cu&t\tShift+Del", EDITCUTMENUITEM "&Copy\tCtrl+Ins", EDIT-COPYMENUITEM "&Paste\tShift+Ins", EDITPASTEMENUITEM "C&lear", EDITCLEARMENUITEM SEPARATORMENUITEM "Select &AINCtrl+A", EDITSELALLMIENUITEM "&Reformat~tCtrl+R", BRREFORMMENUITEM SEPARATORMENUITEM "D&elete Class", BR-DELCL, grayedMENUITEM "&Delete Method", BR-DELME, grayed

END

MENUITEM "&Doit!", INSP -DOITMENUITEM "&Inspect!", INSPISEL

POPUP "&Options"BEGINMENUITEM "A&bout the class", BR-CABOUT, GrayedMENUITEM "&Make descendant', BR-CDES, GrayedMENUITEM SEPARATORMENUITEM "&Class methods", BR -CMEThMENUITEM "&Object methods", BR-OMETHMENUITEM SEPARATOR

80

MENUITEM "&Alphabetical", BRALPHMENUITEM '&Hierarchical", BR..HIERMENUITEM SEPARATORMENU1TEM "&ZooniEdit\tCtrl+Z", BR.ZOOMMENUITEM "&Refresh Class List", BR.REFRCL

END

POPUP "&Utility"BEGINMENiJITEM '&Implementors", WORKIMPMENUITEM "&Senders", WORK_SYMSENDMENUITEM "&Global References", WORK_GLOSENDMENUlTEM "&References", WORK_SENDEND

POPUP "&Templates"BEGIN

MENUITEM '&do", TEMPDOMENUITEM "&if/then", TEMPIFMENUITEM "if/&else", TEMPIFELMENUITEM "&block", TEMPBLOCKMENUITEM '&select/case", TEMPCAsem*nUITEM "&oop", TEMP-LOOPMENUITEM SEPARATORMENUITEM "&New method", TEMP_NMETHi

ENDEND

WorkMenu MENUBEGIN

POPUP "&File"BEGINMENIJITEM "&Run. .g... WORK_RUNMENUITEM "&Edit'.. WORKEDITMENUITEM "&Load...", WORK-.LOADMENUITEM "&Snapshot", WORKSNAPEND

POPUP "&Edit"BEGINMENUITEM "Cu&f~tShift+DeI ", EDIT-CUTMENUITM "&Copy\Ctrl+Ins", EDIT -COPYMENUITEM "&Paste\tShift+Ins", EDITPASTEMENUITEM "C&ear', EDIT-CLEAR

81

MENUITEM SEPARATORMENUlTEM "Select &AII\tCtrl+A", EDITSELALL

END

MEN~LTEM "&Doit!", INSP-DOIT

MEfNUITEM "&Inspect!", INSPISEL

MENUITEM "&Browse!", WORK_BROWSE

MENIJITEM "&Cleanup!", WORK_CLEAN

MENUITEM "&Show Room!", WORKROOM

POPUP "&Utility"BEGINMENIJITEM "&Implementors", WORK_-IMPMENJITEM "&Senders", WORKSYMSENDMENITEM "&Global References", WORKGLOSENDIMENUITEM "&References", WORKSENDMENUITEM SEPARATORMENUITEM '&Clear Display", WORKCLSDISP

END

POPUP '&Temnplates"BEGINMENUITEM '&do", TEMPDOMENUITEM "&if/then", TEMPIFMENUITEM "if/&else", TEMPIFELMENUITEM "&block", TEMPBLOCKMENUITEM '&select/case', TEMPCAsem*nUITEM "&loop", TEMPLOOP

ENDMENUITEM "Demos!", WORKDEMO

END

FileEditMenu MENUBEGIN

POPUP "&File"BEGINMENUITEM "&New", FILENEWMENUITEM "&Open ... ", FILEOPENMENUITEM "&Insert File...", FILEREAD)MENUITEM "&Save", FLLESAVE

82

MIENUITEM "Save &As ...... FILESAVEASEND

POPUP "&Edit"BEGINMENUITEM "Cu&t\tShift+Del", EDIT-CUTMIENUITEM "&Copy\.tCtrl+Ins", EDITCOPYMENUITM "&Paste\tShift+Ins", EDW PASTEMENUITEM "CMear", EDITCLEARMENUITEM SEPARATORMENUTEM "Select &AIInCtrl+A", EDITSELALL

ENDMENUITEM "&Doit!", INSP_-DOlTMENUITEM "&Inspect!", INSPJSEL

END

83

APPENDIX B.ACTOR CODE FOR DMWINDOW CLASS

The following listings are the DMWindow class code that was either created or

modified for the implementation of this thesis.

/* GLAD Window for data manipulation interaction */!!

inherit(MyWindow, #DMWindow, #(dbSchema /*meta data of opened db*/prevObj /*previously selected

object if any */selObj /*currently selected

object if any*/colorTable /*available colors for

shading*/rectSize /*width & height of object rectangle

expressed in Point*/objMoved /*true if object is

dragged*/prevCurPt /*previous cursor point

while object is dragged*/boundRect /*bounding box that surrounds all objects.

used for scroll bars & setting windoworg*/logOrg /*origin of logical coordinate,

mapped to device coord (0,0)*/hScroll /*true if there is HScrollBar*/vScroll /*true if there is VscrollBar*/bDDEAcknowledge /* has DDE initiationbeen acknowledged? */mbdsDB /* Is the current DB an MBDSdatabase? */hSockets /* Handle of Socket interface window */haveData /* have the results of the retrieve come back? */awaitingData /* Are we waiting for data from MBDS */waitDialog /* Dialog box which shows while waiting for data */dbName /* Name of the database */qwin /* query window */), 2, nil)!!

now(DMWindowClass)!!

84

now(DMWindow)!!

/* comment *IDef returnQuery(self I win,aStr, aComnund)

aStr: formulateRetrieve(self);aCommand: addAtom(self, 1P(aStr));Call PostMessage(hSockets, WWDDEREQUEST, hWnd, pack(CF-TEXT,

aCommand));

waitDialog: new(Dialog);runModal(waitDialog, DATAWAIT, self);

haveData := "YES";

if haveData = "YES"win := new(ListMem'Aindow,self,"GladLMMenu", "BROWSE:

"+name(selObJ ),nil);add Window(selObj ,win);start(win,se]Obj);

endif;

Def QueryMembers(self I queryDialog aStr aCommand win)

if not(selObj)errorBox ("ERROR! ","No object is selected")

elseif mbdsDB

awaitingData := true;queryDialog := new(lnputDialog," Queries to

MBDS ","Query: ","FIRST@ [");if runModal(queryDialog,INPUT-BOX,ThePort)==IDOK

aS tr:=getText(queryDialog)endif;

aStr:= "020"+ aStr;aCommand := addAtomn(self, lP(aStr));Call PostMessage(hSockets, W'MDDEREQUEST, hWnd, pack(CF-TEXT,

aComnand));

wait.Dialog := new(Diailog);

85

runModal(waitDialog, DATAWAIT, self);else haveData := "YES";endif;if haveData = "YES"win:= new(ListMemW'mdowself,"GladLMMenu","BROWSE:

"+name(selObj),nil);

addWindow(selObj,win);start(win,selObj);

endif;endif

/*RetCommon queries into the database*/

Def qRetCommon(self)IerrorBox("query Retrieve Common","")!!

/*Delete queries into the database*/

Def qDelete(self)Ii

errorBox("query Delete","")

/*Update queries into the database*/

Def qUpdate(self)IerrorBox("query Update","")}H!

/*Insert queries into the database*/

Def qlnsert(self)IerrorBox("query Insert","")

/* Formulate a retrieve request to get selected MBDS object's data */

Def formulateRetrieve(self I aStr, attribs)

aStr := new(String, 100);

86

aStr :="020" + asUpperCase(dbName) + 1@11 + -"[RETREVE(I7EMP=" +name(sclObj) + ")(";

attribs: new(String, 50);attribs:="do(attributes(selObj),

(using(attr)attribs :=attribs + asUpperCase(attr[NAME]) + ""

aStr: aStr + attribs + "W";

aStr :=subString(aStr, 0, index~f(aStr, '&', 0) - 1);aStr: aStr + ")BY ";

aStr : aStr + subString(attribs, 0, index~f(attribs, ',', 0)) + ""

IN!

/* Tell MBDS to load the appropriate database *Def loadMBDSDatabase(self, dbName I aStr, aCommand)

aStr: delete(dbNarne, 0, 4);aStr leftJustify(aStr);aStr asUpperCase(rightJustify(aStr));aStr: "010" + aStr;aCommand :=addAtom(self, IP(asciiz(aStr)));

Call PostMessage(hSockets, WMDDE-REQUEST, hWnd, pack(CF§I'EXT,aCommand));

1* Handle Dynamic Data Exchange acknowledgments *Def WMDDE-ACK(self, wp, lp I aServer, aTopic)

aServer :=Call GlobalFindAtom(lP(asciiz(" Sockets"));aTopic :=Call GlobalFindAtom(lP(asciiz("Database")));deleteAtom(self, aServer);deleteAtom(self, aTopic);hSockets :=wp;bDDEAcknowledge :=true;

/* Get the latest data for a MBDS object *

Def getMembers(self I aStr aCommand)

aStr :=formulateRetrieve(self);

87

aCommand: addAtom(self, LP(aStr));Call PostMessage(hSockets, WMDDE-REQUEST, hWnd, pack(CfiIEXT,

aCommand));M!'

/* Handle Socket interfaces's WM_-DDEDATA messages here *Def WM_DDE_DATA(self, wp, ip I mbdsCommand, aStr, objfile, delFile)

aStr: getAtom(self, high(lp));deleteAtom(self, high(lp));mbdsCommand: subString(aStr, 0, 3);select

case mbdsCommand = "020"objFile :=new(File);delFile: new(File);setName(delFile, memberFile(selObj));delete(delFile);setName(objFile, "qresults.fil");reName(objFile, memberFile(selObj));setHaveMembers(selObj, true);haveData: "YES";if awaitingData

end(waitDialog, 0);endif;,

endCase;

defaulthaveData: "ERROR";if awaitingData

end(waitDialog, 0);endif;errorBox("ERROR", delete(aStr, 0, 3));

endSelect;

1* Return the string that the atom references ~Def getAtom(self, atom I bufStr, aStr)

bufStr: new(String, 100);Call GlobalGetAtomName(atom, 1P(bufStr), 100);

aStr :=removeNulls(getText(bufStr));

88

freeHandle(bufStr);

/* Delete or decreae the count on an atom *Def deleteAtom(self, param)

if ((param >= OxCOOO) and (param <-- OxFFFF))AMal GlobaiDeleteAtom(paraxn);

endif;Anil

P!

1* Create a new atom or increment the count of one that already exists ~Def addAtom(self, param)IACall GlobalAddAtom(param);freeHandle(param);

W!

f* Initiate Dynamic Data Exchange with the Socket interface *

Def initDDE(self, reason I aServer, aTopic)

bDDEAcknowledge :=false;* aServer: addAtom(self, IP(asciiz('Sockets")));

aTopic :=addAtom(self, lP(asciiz("Database")));Call SenclMessage(OxFFFFL, WMDDEINITATE, hWnd, pack(aServer,

aTopic));if not(bDDEAcknowledge)if reason = "initDDE"errorBox('ERROR ","tUnable to initiate DDE with the Socket Interface");

endif;Afal se;

else

endif;

Def reDraw(self, obj I hdc)

hdc :=getContext(self);

setLPtoDP(self,hdc);

display(self,obj ,hdc);

89

releaseContext(self,hdc)W! H!

/*gets the filename from the name listed in the listbox*IDef getGLADfllename(self ,selDbI tinpStr)

ttmpStr: new(String,30);UnpStr:";do(selDb, 4 using(elem)

if elem <>'tnipStr: tmnpStr + asString(elem)

endif D);AsubString(trnpStr,O,7) + ".sch'

H H! H! !

/*returnsp* the currently selected object*/Def selObj(self)IAselObj

P* draws an object on the window usingthe hdc display context */

Def display(selfobj,hdc I objName, objRect,hBrush, hPen, hOldBrush, hOldPen)

eraseRect(self,obj ,hdc); P*first erase it*//*select the color brush for filling

used with Rectangle (via draw) */hBrush :=Call CreateSolidBrush(color(obj));/*set bkcolor for shading with DrawText*ICall Set~kColor(hdc,color(obj));hOlciBrush :=Call Select~bject(hdc,hBrush);objRect :=rect(obj);if obj.thick]3order /*draw it with a thick border*/

hPen := Call CreatePen(O,5,Call GetTextColor(hdc));hOldPen:= Call SelectObject(hdc,hPen);draw(objRect,hdc);Call SelectObject(hdc,hOldPen);/*restore the dc*/Call DeleteObject(h.Pen)

elsedraw(objRect,hdc) /*with a reg. border*/

endif;if nesting(obj) /*draw the inner box if it is a nested object*/

90

draw(nestedRect(obj),hdc)endif;

objName: name(obj);Call DrawText(hdcJP(objName),- 1 objRect,

DT-CENTER bitOr DTVCENTERbitOr DTSINGLELINE);

Call SelectObject(hdc,hOldBrush);Call DeleteObject(hBrush);freeHandle(objName)

H

/*eae the region a little larger than objectrectangle in case it is displayed with a thickborder*/

Def eraseRect(selfobj,hdc I hBrush tmpRect)

tnipRect :=copy(rect(obj));hBnish: Call CreateSolidBrush(WHITECOLOR);Call FillRect(hdc,inflate(tmpRect,5,5),hBrush-);Call DeleteObject(hBrush)

* I !H

/*clientRect for DMWindow ignores the scroll bars* if present*/

Def clientRect(self I cRect, incr)

cRect :=clientRect(self.WindowsObject),if hScrollincr: Call GetSystemMet-ics(3);/*SM...CYHSCROLL*/setBottom(cRect, bottom(cRect)+incr- 1)

endif;if vScrollincr: Call GetSysteniMetrics(2);/*SM-CXVSCROLL*/setRight(cRect, right(cRect)+iner- 1)

endif;'AcRectH !

/*move veil scroll bar down for incr amount*/

Def moveDownVScroll(self, incr I newy)

newy :=min(y(logOrg) + incr,

91

bottom(boundRect) - height(clientRect(self)));IPadjust newy so it won't go beyond boundRect*/sed~ogOrg(self,x(logOrg),ncwy);setScrollPos(self,SB..YERT,newy);repaint(self)

H !

/*movc vert scroll bar up for incr amount*/Def moveUpVScroll(self, incr I newy)I/*adjust newy so it won't go beyond boundRect*/

newy := ax(y(logOrg) - incrtop(boundRcct));setLogOrg(self,x(logOrg),newy);setScrollPos(self,SB..YERT,newy);repaint(self)

I I

/*check if any of four constraints is violatedif so adust accordingly */

Def checkForViolation(self I cRect)

cRect :=clentRect(self);if (x(logOrg)+right(cRect)) > right(boundRect)log~rg.x :=nax~left(boundRect),

right(boundRect)-right(cRect));setRight(boundRect, max(x(logOrg)+right(cRect),

right(boundRect)))endif;

if (y(logOrg)+bottom(cRect)) > bottom(boundRect)logOrg.y :=max(top(boundRect),

bottom(boundRect)-bottom(cRect));setBottom(boundRect,mac(y(logOrg)+bottom(cRect),

bottom(boundkect)))endif;

if x(logOrg) < left(boundRect)setLeft(boundRert, mninoleft(boundRect),

right(boundRect)-right(cRect)));IogOrg.x :=left(boundRect)

endif;

92

if y(logOrg) < top(boundRect)setTop(boundRect, min(top(boundRect),

bottom(boundRect)-bottom(cRect)));logOrg.y: top(boundRect)

endif

I*cdient~ect has changed. process only if thechange is not by the changes in scrollbars, i.e. window size really changed *

Def reSize(selfwpjlp)

adjBoundRect(self);/*always be adjusted*/setScrollRanges(self);repaint(self)

/*move horz scroll bar right for incr amount*/Def moveRightHiScroll(self, incr I newx)

newx :=min(x(IogOrg) + ineT,right(boundRect)-width(clientRect(self)));

* /*adjust newx so it won't go beyond boundkect*/sed~ogOrg(self,newx,y(logOrg));setScrollPos(self,SB-HORZ,newx);repaint( self)

/*move horz scroll bar left for incr arnount*/Def moveLcftHScroll(self, incr I newx)

newx :=max(x(logOrg) - incrIeft(boundRect));/*adjust newx so it won't go beyond boundRect*/setLogOrg(self,newx,y(logOrg));setScrollPos(self,SB-HORZ,newx);repaint(self)

Def hThumbPos(self, ip I newx)

93

newx :=aslntop);setLogOrg(self,newx,y(logOrg));sctScrollPos(self,SB..HORZnewx);repaint(self)H I

Def vThumbPos(self, Ip I newy)

newy :=aslnt(lp);sedtogOrg(self,x(logOrg),newy);setScrollPos(self,SB3TERTnewy);repaint(self)H!

Def downPage(selfIp)InioveDownVScroll(self,height(clientRect(self)))H !

Def upPage(selflp)

moveUpVScroll(self,height(clientRect(self)))

Def rightPage(selflp)

moveRightHScroll(selfwidth(clientRect(self)))

Def leftPage(selfIp)ImoveLeftHScroll(self,width(clientRect(self)))

H !

Def rightArrow(selflp)

moveRightHScroll(self,aslnt(O.25*x(rectSize)))H !

Def downArrow(selflp)

moveDownVScroll(self,asnt(O.5*y(rectSize)))

94

H !

Def upArrow(selflp)

moveUpVScroll(self,aslnt(O.5*y(rectSize)))

Def leftArrow(selflp)ImoveLeftHScroll(self,aslnt(O.25*x(rectSize)))

/*convert device pt (DP) to logical pt (LP)*/Def dPtoLP(selfaPt)

Apojnt(aPt.x + logOrg.x, aPt.y + logOrg.y)H

/*set the logical coord. origin*/Def setlogOrg(self,x,y)

logOrg.x x;logOrg.y yH !

/*log~rg is now mapped to device coord. (O,O)*//*ned to pass hdc since there could be two disp contextallocated to this window at one time ~Def setLPtoDP(self, hdc)

Call SetWindowOrg(hdc,x(logOrg),y(logOrg))I !!

Def setScrollRanges(self I xmin,ymin,xmax,ymax)

xmin :=eft(boundRect);ymin:=top(boundRect);cRect :=cientRect(self);if (xmax: :=rght(boundRect)- width (cRect)) < xminxmax: xmin

endif;

if (ymax:=bottom(boundRect)-height(cRect)) < ymin

ymax ymin

95

endif;hScroll= xmin < xmax;vScroll: ymin < ymax;setScrollRange(self,SB..HORZ,xnmin~xmax);setScrollRangc(self,SBTERT,yrnin,ymax)

H

Def adjBoundRect(self ItmpRect)

tmnpRect:=copy(boundRect);boundRcct:=copy(rect(first(dbSchema)));do(dbSchena,

I using(obj I objRect)objRect :=rect(obj);setTop (boundRect,min(top(objRect),top(boundRect)));sed~eft (boundRectminoeft(objRect),left(boundRect)));setBottom(boundRect,max(bottom(objRect),bottom(boundRect)));setRight (boundRect,max(right(objRect),right(boundRect)));

/*changes boundRect accordingly per violation*/checkForViolation(self);if tmpRect = boundRect

Anl

endif

Def start(self, databaseName I dosFilename, DDElnitiated)

dbName databaseName;mbdsDB false;if subString(dbName, 0, 4) = "MBDS"

mbdsDB := true;if not(initDDE(self, "socketActive?"))

exec("sockets.exe");endif;if (DDElnitiated :=initDDE(self, "initDDE"))loadMBDSDatabase(self, dbNane);dbName,: delete(dbNanie, 0, 5);

endif;endif;if not(mbdsDB) or DDElnitiated

dosFilenanie :=getGLADfilename(self,dbName);loadSchema(self, dosFilename);adjBoundRect(self);

96

sedogOrg(self, IPcenter of bRect to center of cRect*Ileft(boundRect)+aslnt(O.5*(width(boundRect)-width(cientRect(self))),Itop(boundRect)+aslnt(O.5*(height(boundRect)-height(clientRect(self)))));

* setScrolRanges(self);setScrollPos(self,SB..HORZ,x(logOrg));setScrollPos(self,SB..YERT,y(logOrg));show(self, );

endif;

/* set the width and height of object rectangle*/Def setObjRectSize(self I tin, wd, ht)

tm n new(Struct,32);Call GetTextMetnics(hDC:=Call GetDC(hWnd),tm);wd:= 1 4*aslnt(wordAt(tm, 10));ht:= 4*as~nt(worciAt(tm, 0));rectSize :=point(wd,ht);Call ReleaseDC(hWnd,hDC)

* /*mouse is dragged while left button is pressed.move obi if mouse is in it *1

Def mouseMoveWithtBDn(selfwp,point I aLPt)

if selObjobjMoved :=true;eraseRect(self,selObj ,hDC);aLPt:= dPtoLP(selfpoint); /*convert to DP to LP*/setNewRect(selObj ,aLPt,prevCurPt);prevCurPt:= aLPt;display(self,selObj,hDC)

endifH !

Def initMenulD(self)

menulD: %Dictionary( 1l->#describe2->#expand3->#listMembers

4->#oneMember

5- >#addM ember6->.#deleteMember

97

7->#modifyMember8->#query9->#showConnection950->#helpll->#close21 ->#describe22->#qlnsert23->#qRteaieve24->#qUpdate25->#qDelete26->#qRetConimon)

Def showConnection(self I aConnWin)

errorBox("Show Connection"'"')

Def expand(self Iwin)

if not(selObj)errorBox ("ERROR! ","No Object is selected")

elseif not(nesting(selObj))errorBox('ERROR! ","Selected Object is not a nested object")

elsewin := new(NestDMWindow,self, "GladDMlMenu",

"SubClasses of: "+name(selObj' nil);add Window(selObj ,win);start(win ,selObj ,colorTable)

endifendif

H !

/*open oneMemWin for the selected object*/Pef oneMember(self I oneMemWin, gotMembers)

if not(selObj)errorBox( "ERROR", "No Object Selected")

elseif mbdsDB and not(haveMembers(selObj))

98

gethembers(self);awaitingData := true;waitDialog :=new(Dialog);runModal(waitDialog, DATAWAIT, self);

else haveData :="YES";endif;if haveData = "YES"oneMemWin: new(Display~neWindowself,"GladOMMenu",

"DISPLAY: "+naxne(selObJ),nil);addWindow(selObj,oneMemWin);start(oneMemWin,selObJ,O);

endif;endif

/*count the number of the describe window opened*/Def countOpnDscrbWin(self)

Asize(extract(dbSchema, I using(obj) obJ.aDscrbV*in )))

/*itjalize the color table. this methodis called from the new method*/

Def init(self)

colorTable :=new(ColorTable,l10);set(colorTable);logOrg :=O@O; /*need dummy assigment,so initial call

to checkForViolation via reSize works*/boundRect:=new(Rect);setObjRectSize(self);init(self.:My Window)

Def rButtonRelease(self,wp,point I tmpObJ)

if (tmpObj := objSelected(selfdPtoLP(selfpoint)))/*an object is clicked with rbutton*/if tmpObJ <> selObJ

if color(tmpObj) == WHITCOLOR

errorBox ("Wrong Button??","Use LEFT button to select an object")

99

elseerrorBox('E R R 0 R",

"RIGHT button clicked object is not"+CRLF+"the selected (bold-lined) object")

endifelse P~ = selObj *

closeOpenWindows(selObj);if not(referenced(selObj))/unshade it if not referenced by other objects*/avail(colorTable,color(selObj));setColor(selObj,WHlTE-COLOR)

endif;

regBorder(selObj);hDC :=get~ontext(self);setLPtoDP(self,hDC);display(self,selObj,bDC);releaseContext(self,hDC),selObj :=nil

endifendif

/*list the members (ie instances) of theselected object*/

Def listMernbers(self I win, gotMembers)

if not(selObJ)errorBox("ERROR! ","No object is selected")

elseif mbdsDB and not(haveMembers(selObj))

getMembers(self);awaitingData : rewaitDialog: new(Dialog);runModal(waitDialog, DATAWAIT, self);

else haveData: "YES";endif;if haveData. = "YES"

win new(ListMemWindow,self,"GladLMMenu ","BROWSE:"+name(selObj),nil);

addWindow(selObj,win);

start(win,selObj);endif;,

100

endifH

/*queries the database*/Def query(selfl db so aStr qwin win aCommand)Iif not(selObj)

errorBox("ERROR", "No Object Selected")elseif mbdsDBawaitingData :=tue;so:= new(String, 50);db:= new(String, 50);so:= name(selObj);db:= asUpperCase(dbNaxne);qwin :=new(QueryWindowself,"QueryGlad",

"Glad to MBDS Queries OF: "+name(selObj),nil);

start(qwin,db,so,hSockets,selObj ,self);

/* aStr := formulateRetrieve(self);aCommand: addAtom(self, IP(aStr));Call PostMessage(hSockets, WMDDEREQUEST, hWnd, pack(CF-ThXT,

aCommnand));

waitDialog: new(Dialog);runModal(waitDialog, DATAWAIT, self);

else haveData := "YES"t;*Iendif;

/* if haveData = "YES"win := new(ListMemWindow,self,"GladLMMenu ", "BROWSE:

"+name(selObJ),nil);add Window(selObj ,win);start(win,selObj),

endif;*/endif

Def help(selflaStr)

aStr :=asciiz("Data Manipulation Window");

pcall(Lib.procs[#GUIDANCESETCONTEXT],HGuide,IP(aStr), 1);

101

freeHandle(aStr);

/*describe the structure of the selected object*/Def describe(self I describeWin)

if not(selObj)errorBox("ERROR", "No Object Selected")

elsedescribeWm : new(DescribeWindowselfnil,

"STRUCTURE OF: "+name(sel~bJ),nil);add Window(selObJ ,describeWin);start(describeWin,selObj)

endif;

/*left button is released*/Def lButtonRelease(selfwp,pointl aLPt)

selectcase selObJ and not(objMoved)/Pan object was not moved, so select it*/is

if prevObj /*unbold the bolded border*/regBorder(prevObj);/*unshade it if has no opened windows

and not referenced by other objects*/if not( anyOpenWindow(prevObj) or referenced(prevObj))

avail(colorTable,color(prevObj));setColor(prevObJ,WHrrE-COLOR)

endif;display(self,prevObj,hDC)

endif;if color(selObj) = WHITECOLOR

/*not referenced in another's describe window,so assign it a color*/

setColor(selObj,nextBrushColor(colorTable))endif;thickBorder(selObj);display(self,selObj,hDC)

endCase

case selObJ and objMoved/Pan object was just moved, so don't select it*/

i 02

IPadjust boundRect and scroll bars accordingly*/isdisplay(self,selObj,hDC);selObj :=prev~bj;if adjBoundRect(self)

setScrollRanges(self);se~croflPos(selfS HRZx(log~rg));/*need these when*~/setScrollPos(self,SB-VERT,y(log~rg));/*bars reappear*/repaint(self)

endifendCase

endSelect;release~ontext(self,hDC)

/*left button is pressed; check if the cursor is withinthe object rectangle. If yes get ready to move orselect it*/

Def lButtonDown(selfwp,point I aLPt)

objMoved :=nil;if selObjfPremember it if some object is currently selected*/prevObJ : selObj

endif;aLPt:= dPtoLP(selfpoint);if (selObj :=objSelected(selfaLPt))

prevCurPt :=aLPtendif;hDC :=getContext(self);setLPtoDP(self,hDC)

/*etects whether the cursor is in the object rect*/Def objSelected(selfcursorPt)

do (dbSchema, I using(obj)if containedln(obj,cursorPt)

Aobj /*return the selected obj*/endif))

Anil

/*draws the diagram. called by the show method

103

via update method which sends WMPAINT *Def pamnt(selfhdc)

sedL~toDP(self,hdc);do (dbSchema, I using(obj) display(selfobj,hdc)))

/*gets the meta data of db to be opened,initialize other instance variables*/

Def loadSchema(self, aSchemaFile I aFile, anObj)

aFile :=new(TextFile);setName(aFile,aSchernaFile);open(aFile,O); /*read-only*/dbSchema: new(OrderedCollection,1O);anObj :=new(Glad~bj);loopwhile get(anObj ,aFile,rectSize)

add(dbSchema,anObj);anObj :=new(GladObj)

endLoop;close(aFile)

Def addMember(self)

IerrorBox("addlt member","")

Def modifyMember(self)

errorBox("modify member".....)

104

APPENDIX C. ACTOR CODE FOR QUERYWINDOW CLASS

The following listings are the QueryWindow class code that was either created or

modified for the implementation of this thesis.1* GLAD Window for AIBDL queries to backend MBDS *1!

inherit(EditWindow, #Queryinmdow, #(menulD /* menu idenities *dbName P~ database name */sel~bJName /* selected object *mbdsDB P* Is current DB an MDBS database *boundRect/* *logOrg /* */hSockets P* handle of Socket interface window *haveData P* have the results of the query come back *awaitingData /* Are we waiting for data from MBDS *waitDialog /*Dialog box which shows while waiting for data *mbdsDB P~ is the current DB an MBDS database */bDDEAcknowledge /*has DDE initiation been acknowledged? *selObj P* the selected object */parentWin P~ parent window DMWindow *retquery /* is the query a retrieve */ResuitWin P~ textwindow for retrieve results *members/* */TW/* is the template window */), 2, nil)!!

now(Query~indowClass)!!

now(QueryWndow)!!

P~ comment */Def Help(self)

errorBox("Help","This program demonstrates simple ABDL" + CR_LF +"iqueries to a MBDS back-end" + CR_-LF +"For a example of each type of query," + CRLF +"look under the template's menu item" + CR_LF +"and select the specific query.");

105

/*Delete queries into the database*/Def tDelete(self)I

TW: new(TextWindowTePortnil,"Format for an DELETE Query",&(20,20,400,100));show(W, 1);drawString(TW,"dbName@ [DELETE((TEMP=selObj) and");eol(TW);drawString(TW " (AttrI = jones)) I)

setFocus(self);

H !

/*Update queries into the database*/Def tUpdate(self)

TW: new(TextWindowThePort,niI,"Format for an Update Query ",&(20,20,400, 100));show(TW, 1);drawString(TW,"dbName@ [UPDATE((TEMP=selObj) and");eol(TW);drawString(TW," (Attnl = jones)) <RANK = ENS>]");

setFocus(self);

/*Retrieve queries into the database*/Def tRetrieve(sclf)

TW: = new (TextWindow,ThePort,nil,"Format for an RETRIEVE Query",&(20,20,400, 150));show(TW, 1);printString(TW,"dbName@ [RETRIEVE((TEMP=selObjA)");eol(TW);

printString(TW," and (Attrl =jones))");

106

eol(TW);printString(TW," (Attrl,Attr2,Attr3..)]");setFocus(self);

'V!

/*RetCommon queries into the database*/Def tRet~ommon(self)

TW: new(TextWindowThePortnil,"Format for an RETRIEVE COMMON Query",&(20,20,400,150));show(TW, 1);printString(TW,"dbName@ [RETRIEVE(TEMP=selObjA)(AttrA 1,AttrA2,..)");eol(TW);printString(TWV," COMMON (AttrAl ,AttrB 1)");eol(TW);printString(TW," RETRLEVE(TEMP= selObjB)(AttrB 1,AttrB2,..)]");setFocus(self);

/*Insert queries into the database*/Def tlnsert(self)

TW: new(TextWindow,ThePort,nil,"Format for an INSERT Query",&(20,20,400, 100));show(TW, 1);drawString(TW, "dbName@ [INSERT(<TEMP,selObj>,");eol(TW);drawString(TW,' 'cAttr 1 jones>,<Attr2,LT>)I ");

setFocus(self);

107

/* Read the file named qwresultdat and And show query results for retrieves*/

Def RetResult(selfl f, line)

break(self);

f :=new(TextFile);fEdelimiter :=CR.LF; P~use our delimiter *setName(f, "qwresultdat");open(f, 0); P* read only *checkError(f); P~ any errors? *initWorkText(self); /* clear the old text *showWaitCursO; P* looping takes a while ~

loopwhile line: readtine(f)printString(ResultWin,line);eol(ResultWin);/* add(workText, line);*/endLoop;

show~ldCursQ; /* all done *close(f);checkError(f); P* just in case *invalidate (self); P* redraw the screen ~

I

/* comment ~Def formulateQuery(selflaStr)IaStr :=new(String,150);selectAll (self);xCopy(self);aStr:="";aStr:=getClipText(self);

deleteSelText(self);Aasciiz(aStr);

108

1* get the attributes from DMwindow for selobj ~Def describe(self)Idescribe(parentWin);In!

fPlist the members (ie instances) of theselected object*/

Def listMembers(self I win, gotMembers)

queryMembers(self);awaitingData :=true;waitDialog :=new(Dialog);runModal(waitDialog, DATAWAIT, self);haveData :="YES";

if haveData = "YES"

if not(retquery)returnQuery(parentWin);elseResultWin: new (TextWindow,ThePort,nil,

U "RESULTS of a Retrieve Query",nil);show (Re sultWin, 1);

RetResult(self),

endif;

endif;

P* Delete or decrease the count on an atom ~Def deleteAtom(self, param)

if ((paramn >= OxCOOO) and (parani <= OxFFFF))ACaII GlobalDeleteAtom(param);

endif;Anil

109

/* Return the string that the atom references *Def getAtom(self, atom I bufStr, aStr)

bufStr: new(String, 200);Call GlobalGetAtomNarne(atom, IP(bufStr), 200);aStr :=removeNulls(getText(bufStr));freeHandlle(bufStr);AaStr

1* Handle Socket interfaces's WMDDEDATA messages here *Def WMDDEDATA(self, wp, ip I mbdsComniand, aStr, objfile, delFile)

aStr: getAtom(self, high~lp));deleteAtom(self, higholp));mbdsCommand: subSmrng(aStr, 0, 3);select

case mbdsCornmand = "020"objFile new(File);delFile new(File);

setNarne(delFile, "qwresult.dat");delete(delFile);

setName(objFile, "qresults.fii");reNarne(objFile, "qwresult.dat");setl-aveMembers(selObjNarne,false);haveData := "YES";if awaitingData

end(waitDialog, 0);endif;

endCase;

defaulthaveData := "ERROR";if awaitingData

end(waitDialog, 0);endif;errorBox("ERROR", delete(aStr, 0, 3));

endSelect;

110

P* Create a new atom or increment the count of one that already exists *Def addAtom(self, parani ItempAtom)

tempAtom:=-Call GlobalAddAtom(param);

Atemptom;

P!

P* Get the latest data for a MBDS object *

Def queryMernbers(self I aStr aCommand)

aStr :=formulateQuery(selO);

aComnmand :=addA tom(self, IP(aS tr));

Call PostMessage(hSockets, WrMDDEREQUEST, hWnd, pack(CF-TEXT,

aCommand));

Def start(self, qdbNamne, qselObJ, handSocket,selObject,P~indow)

initMenulD(self);show(self, 1);hSockets :=handSocket;selObJNane :=selObject;dbNamne:qdbNarne;selObj :=qselObj;parentWin :=PWindow;retquery: =false;

/*RetCorpmon queries into the database*/Def qRetCornmon(selfl aStr,Rtc, attribs)

retquery:=true;

aStr:= new(String, 150);

aStr:="020'+dbNamre+"@ (RETRIE VE(TEMP='+selObj+' )O";

aStr:=aStr+"COMMON(,)RETRIEVE(TEMP= )O]";

ill

drawString(self,aStr);

I*Retrieve queries into the database*/Def qRetrieve(selfl aStrRet, attribs)

retquery:=true;aStr:= new(String, 150);aStr:="020-edbName+"@ [RETREEVE(TEMP= t+selObj+" )"aStr:=aStr+" )j ";

drawString(self,aStr);

/*Update queries into the database*/Def qUpdate(selfl aStr, Upd, attribs)

retquery:=false;aStr:= new(String, 150);aStr:="020"+dbNarrte+"@ [UPDATE-((TEMP= "+selObj+");aStr:= aStr + "and ( =))< = >jj**drawString(self,aStr);J!!

Def cornmand(selfwp,lp)/*only interprets the menu choice now*'/if menulD[wp] and high(lp) = 1

perform(self,menulD[wp]);else

if menulDllwplperform(self,menulD[wp])

else cormmand(self:EditWindow, wp, ip)endif;

endif;

W!

/*Insert queries into the database*/

112

Def qlnsert(selfl aStr)

retquery:--false;aStr:= new(String, 150);aStr:="020"+dbName+"@[INSERT(<rEMMP,"+selObj+">,<";aStr: aStu + "ENAME,Nardi>,<EPHONEx5555>)] "

drawString(self,aStr);

H

/*Delete queries into the database*/Def qDelete(selfl aStr)

retquery: =false;aStr:= new(String, 150);aStr:="020"+dbNazne+"@ [DELETE((TEMP= '"+selObj+");aStr: aStr + " and ( ))] ";

drawString(self,aStr);

Def initMenuID(sclf)

menuID: %Dictionary(1 O->#Help11I ->#close1 2->#describe21 ->#listMembers22->#qlnsert23->#qRetrieve24->#qUpdate25->#qDelete26->#qRetComnion32->#tlnsert33->#tRetrieve34- >#tUpdate3 5->#tDelete36->-#tRetCommon)

113

LIST OF REFERENCES

1. Ruff, D., LCdr, USN, from:"The Advent of the Paperless Ship," Naval EngineersJournal, July 1988.

2. Duff, C., and others, Actor Language Manual, The Whitewater Group, Inc.,1989.

3. Newburger, B. , and others, "Introduction to Object-Oriented Programming", TheWhitewater Group, Inc., 1989.

4. Duff, C., and others, Actor Training Course Manual, The Whitewater

Group, Inc., 1988.

5. Jamsa, K., Windows Programming Secrets, Osborne McGraw-Hill, 1987.

6. Microsoft Corporation, Microsoft Windows User's Guide, Microsoft Press, 1987.

7. Wu, C.T. , Object-Oriented Programming through Actor, The Whitewater Group,Inc., in progress.

8. Zawis, J.A. , Accessing Hierarchical databases via SQL Transactions in aMulti-Model Database System, Masters Thesis, Naval Postgraduate School,Monterey, California, December 1987.

9. Emdi, B. , The Implementation of a Network Codasyl-DML Interface for theMulti-Lingual database System, Masters Thesis, Naval Postgraduate School,Monterey, California, December 1985.

10. Wong, A., Toward highly Portable Database System, Masters Thesis, NavalPostgraduate School, Monterey, California, June 1986.

11. Hogan, T. R. ,Interconnection of the Graphics Language for Database System tothe Multi-Lingual, Multi-Model, Multi-Backend Database System Over anEthernet Network, Masters Thesis, Naval Postgraduate School, Monterey,California, December 1989.

12. Naval Postgraduate School Technical Report NPS52-88-050, Implementation ofVisual Database Interface Using an Object-Oriented Language, by C. T. Wu andD. K. Hsiao, June 1988.

13. Fore, H. R., Prototyping Visual Interface for Maintenance and Supply Databases,Masters Thesis, Naval Postgraduate School, Monterey, California, June 1989.

114

14. Williamson, M. L., An Implementation of a Data Definition Facility for theGraphics Language for Database, Masters Thesis, Naval Postgraduate School,Monterey, California, December 1988.

1

115

INITIAL DISTRIBUTION LIST

Number Copies

1. Defense Technical Information Center 2Cameron StationAlexandria, Virginia 22304-6145

2. Dudley Knox Library 2Code 0142Naval Postgraduate SchoolMonterey, California 93943-5002

3. Office of Reasearch Adiministration 1Code 012Naval Postgraduate SchoolMonterey, California 93943-5002

4. Chairman, Computer Science Dept. 1Computer Science DepartmentNaval Postgraduate SchoolMonterey, California 93943-5002

5. Chief of Naval Research I800 N. Quincy StreetArlington, Virginia 22217-5000

6. Center for Naval Analyses 14401 Ford AvenueArlington, Virginia 22302-0268

7. Naval Ocean Systems Center 1271 Catalina BoulevardSan Diego, California 92152

8. Curriculum Officer 1Computer Technology Program, code 37Monterey, California 93943-5000

116

9. Professor C. Thomas Wu (Code 52Wq) 25Computer Science DepartmentNaval Postgraduate SchoolMonterey, California 93943-5000

10. Maria M. Jamini-Ramirez 2Division HeadMDS DivisionData Systems DepartmentNaval Weapons StationConcord, California 94520-5000

11. Robert Calogero 2Director SEA CEL-PALogistics Policy and Appraisal DivisionNaval Sea Systems CommandWashington, D. C. 20362-5 101

12. Clifford G. GeigerDeputy Chief Engineer - LogisticsNaval Sea Systems CommandWashington, D. C. 20362-5101

13. LT. William G. A. Sympson 58B Sellers RoadAnnapolis, Maryland 21402

117

ILE- NAVAL POSTGRADUATE SCHOOL · 1 F ILE-NAVAL POSTGRADUATE SCHOOL ... feasibility of providing a visual interface to allow queries from a front end ... Attribute-Based Data Language - [PDF Document] (2024)
Top Articles
Latest Posts
Article information

Author: Dan Stracke

Last Updated:

Views: 6304

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Dan Stracke

Birthday: 1992-08-25

Address: 2253 Brown Springs, East Alla, OH 38634-0309

Phone: +398735162064

Job: Investor Government Associate

Hobby: Shopping, LARPing, Scrapbooking, Surfing, Slacklining, Dance, Glassblowing

Introduction: My name is Dan Stracke, I am a homely, gleaming, glamorous, inquisitive, homely, gorgeous, light person who loves writing and wants to share my knowledge and understanding with you.