1.0 Introduction
The project was chosen because of an interest in programming with Java™ in a way that had not been attempted before within the privately owned (rather than major operators i.e. BP) petrol forecourt "BackOffice" environment. All the current BackOffice software on the United Kingdom market have been written using structured programming, in fact the two main competing software products are both based on the same program written 15 years ago in QuickBasic™.
It was decided at Source Computing Ltd. that the time had arrived to move to a newer programming language, that wasn't Microsoft DOS™ based. This programming language should be one that could take advantage of the power of Microsoft Windows™ and the far more powerful personal computers that are on the market today.
The original system, "Forecourt Plus", is a stock control system that was (and still is) capable of running on an IBM PC 286. Although the backward compatibility has advantages, the majority of current (and potential) customers use far newer, more powerful systems. The visual appearance of "Forecourt Plus" detracted from the perceived ability of the software to perform to the required high standard.
A link written in Java™ between a PC and a Gilbarco TMS-15, using the Comm ports would be an ideal starting point in evaluating Java™. This evaluation would enable an informed decision whether or not to use Java™, to write the new product. The potential advantages of using Java™ being the ease of code reuse, ease of maintainability and the ease in porting the product to other operating systems.
The original link program written in QuickBasic™ was studied and a design was reverse engineered. The advantages and disadvantages of this program were then noted before designing and developing the Java™ version.
The Till_Link software and the CommTest software are both based on the SerialDemo software supplied with the Java™ Communications API.
Six Software Engineers then reviewed both versions of the software and evaluated whether the Object-Orientated version did have the anticipated advantages over the Structured version.
This chapter identifies the aims of the project then gives overviews of Structured Programming, QuickBasic™, Object-Orientated Programming and finally Java™.
1.1 The Project Aims:
1.2 Overview of Structured Programming
During the mid to late 1960's Edsgar Dijkstra and colleagues[BOH66, DIJ65, DIJ76] proposed the use of logical constructs in the formation of a program. The basic concept being, that a large problem is broken down into smaller and smaller parts - a top down approach - until the stage is reached, whereby simple, understandable code can be produced for that part. This means that a program is simple to understand and the logical flow will be visible. The major problem of structured programming is the ability to reuse code. As the lowest levels of the structure are approached, the code within becomes more and more specialised and this makes code reuse hard.
1.3 Overview of QuickBasic™
During the mid-60's John Kemeny and Thomas Kurtz developed a new language to teach programming called BASIC (Beginner's All Purpose Symbolic Instruction Code). It was successful for three main reasons:
When the MITS Corporation of Albuquerque, New Mexico was developing a personal computer called Altair (the first personal computer) in 1975, Bill Gates and Paul Allen developed a version of BASIC for it and formed Microsoft. This first version ran in 4K of memory.
Microsoft then went on to produce BASIC for other microcomputers including Apple, Commodore, Atari and also IBM when the IBM PC was launched. The version of BASIC released with the IBM PC was called BASICA and was leased from Microsoft by IBM. The number of commands had increased to 200 and it needed more than 40K of memory, as Nathan Myhrvold states:
"..it turns out that like hardware, software also has to undergo something like Moore's Law. I did a study of a variety of Microsoft products: I counted the number of lines of code for successive releases. Basic had 4,000 lines of code in 1975. Currently, it has perhaps half a million."
(Brand, S (1995), "The Physicist" - Wired, 3.09,September.)
BASICA unfortunately only runs on IBM PCs because part of the language is held on ROM's which IBM produce and fit to only their computers. Microsoft developed GW-BASIC, which runs in RAM and can used on any IBM compatible PC. BASICA is an interpreted language, in that program instructions are interpreted by software when the program is run and this software turns the instructions into machine code. These machine code instructions run on the computer. Whereas GW-BASIC is compiled and the compiled code is run on the computer.
GW-BASIC was replaced in 1985 when QuickBasic Version 1.0 was released. QuickBasic has gone through number of evolutions, QuickBasic Version 4.5 being the last (released in 1988) until it was superseded by Visual Basic for DOS (which became Visual Basic when ported to the Windows Operating System).
1.4 Overview of Object-Orientated Programming
Object-Orientated Programming (OOP) is based upon information hiding (Parnas, 1972), abstract data types (Liskov and Zilles, 1974) and the work on the Smalltalk (Goldberg and Robson, 1983) programming language. Object-Orientation's basic concepts allow the breaking down of systems into their components or classes. A class holds both the data and the actions, which can be performed, on that data. This enables data encapsulation and areas of shared data are eliminated.
1.5 Overview of Java™
The Java™ programming language originated in 1991, when a group of Sun Microsystems engineers, led by Patrick Naughton and James Gosling wanted to produce a programming language for use in consumer devices such as the television set-top box and was code named "Green". The language had to be able to operate on any CPU because manufacturers of these devices used numerous processors.
The model used to enable this was based on a model first pioneered by Niklaus Wirth and later used by UCSD Pascal. The language produced intermediate code that ran on a "virtual machine" which in turn ran on the processor. This meant that only the "virtual machine" had to be specifically written for the processor and the intermediate code produced by the Java™ could run on any of these "virtual machines".
The language's syntax was based on that of C++ rather than Pascal, which meant that Java™ was object-orientated rather than procedural (or structured) and was named "Oak". This was then changed when it was realised that "Oak" was already a name of another programming language.
The "Green" project produced it's first product, called "*7" (an intelligent remote control), in 1992 but nobody at Sun Microsystems was interested, so they bid for, and lost, a contract to design a set - top box that could deal with cable on-demand and other new services.
The project name was then changed to "First Person Inc." and all 1993 and half of 1994 was used trying to find buyers for this new technology, but because no buyers were found, "First Person Inc." was dissolved in 1994.
During this time, the World Wide Web was increasing in size rapidly and the key to its use was the hypertext browser used to view the pages. Marc Andreesen developed this in 1993, while he was an undergraduate student on a work-study project, at the University of Illinois. The project members realised that they could
"build a real cool browser. It was one of the few things in the client/server mainstream that needed some of the weird things we'd done: architecture neutral, real-time, reliable, secure - issues that weren't terribly important in the workstation world. So we built the browser."
(Cornell, G. & Horstmann, C (1999), Core Java 1.2: Volume I - Fundamentals, Prentice Hall.)
The browser was written by Patrick Naughton and Jonathon Payne and was written to show off the power of Java™, but also to show the capabilities of "Applets" (small Java™ programs that run within a browser capable of interpreting Java™ bytecodes).
In 1995, later in the year after the browser was shown at SunWorld, Netscape decided to make Netscape 2.0 Java™ enabled, followed by many other licensees.
In 1996, Sun Microsystems released Java™ 1.0, followed quickly by Java™ 1.02 but for other than "applet" use over an enabled browser, the language wasn't capable enough for "real" applications, lacking even the ability to print on a printer. In 1997, Java™ 1.1 was released that remedied many of these problems and in 1999, Sun Microsystems released Java™ 1.2 (commonly known as Java™ 2.0). These last two releases more than doubled the size of the original libraries used in version 1.0.