Page 249
This chapter begins Part IV of the book, which covers Oracle's user interface, the Oracle Forms 4.5 rapid application development software, a component of the Oracle Developer 2000 package. This chapter introduces you to a form and form terminology. The main goal of the chapter is to show you how to operate a form. Subsequent chapters cover all facets of the product. When you have finished this part of the book you should be able to develop the applications for the prototype system. In fact, the installment at the end of this chapter is designed to develop the on-line application for the Employee system.
Page 250
NOTE |
You can use the EMPLOYEE.FMX form to practice the techniques discussed in this chapter. It is available on the CD. |
A form is a graphical user interface (GUI) application that allows the user to add, modify, delete, and view database records. There are many products on the market that are used to develop forms. Some of the non-Oracle products available that you can use to develop forms are Visual Basic and Borland's C++. These products offer powerful tools for developing Windows-type forms, but in my opinion cannot hold a candle to developing applications by using Oracle Forms.
Oracle Forms is a preferred software development package because Oracle has tied the Oracle7 database directly to the application development software. When the developer first places fields on the form, the ties to the database are created. The developer does not have to develop application code to add, update, delete, or retrieve records. As part of the basic form, Oracle has built-in the DDL commands that other software products require the developers to define. In addition, when the form items are linked to the database, the database constraints are automatically added to the form as edits. It is literally possible to develop a fully functional application by using Oracle Forms in minutes. I don't know of other packages that give the developer this power.
A screen or form developed by using Oracle Forms can have many features that allow developers to fully exercise their creativity. Developers can place push buttons, radio buttons, pick lists, lists of values, and check boxes on their forms. The product has a screen painter that allows the developer to move and reshape items. The developer can choose from an array of colors and fonts. Oracle's screen painting environment is a very powerful tool for the creative developer.
Some applications require sophisticated programming logic. PL/SQL can be embedded into the form by using triggers to execute the code. This offers the developer an excellent tool to control the behavior of the application. Oracle Forms also has a menu module that allows the developer to create menus. These menus have pull-down lists and can be used to tie applications together.
Figure 11.1 illustrates the form discussed in the next several chapters. This form contains information from the sample Employee database. The form displays an employee's principal attributes as well as eyeglass and tool purchases. The application is a master-detail form, which means the form contains a master record and associated detailed records about the employee listed in the master record. In this example form, the master record is the employee and the detail records are the eyeglass and tool purchases. Master-detail forms exist when there are too many relationships between tables (discussed in Chapter 2). A nice feature of Oracle Forms, it develops the code that keeps the sets of records in sync on a form. Users do not have to develop it as they do in other products.
Page 251
FIG. 11.1
A Master-Detail form
containing employee
database records.
The sample form in this chapter has a number of features that increases its user friendliness. It contains a button that displays a list-of-values (LOV) for the department name. The LOV can be launched by pressing the button to the left of the department field. Pressing this button causes a dialog box to appear, which displays the values from the department table. The form also has radio buttons that are pushed to denote the correct gender value. At the bottom of the screen are push buttons that allow the user to scroll forward and backward, query a record, save changes, and quit the application.
The form in Figure 11.1 has a number of components worth mentioning. To begin with, Oracle calls the application or form a module. The area of the screen that contains fields, buttons, or boilerplate is called a canvas. The canvas may be larger or smaller than the screen. A window overlays the canvas. If the canvas is larger than the window, vertical and horizontal scrollbars appear. They allow the user to scroll and display previously hidden parts of the canvas. At the top of the screen is a menu tool bar. The one in Figure 11.1 is the default menu. At the very bottom of the screen is a status line that contains pertinent messages.
The rectangular boxes on the screen contain data values, which are called items. An example of an item is the box that contains the last name "EISENHOWER." The items of the form are preceded by text or boilerplate. Boilerplate is textual information on the canvas, used to describe items. The words "Last Name" are the boilerplate for the last name item.
The items are generally linked to an Oracle table and are grouped into records. The top-third of the screen contains a number of items that comprise one employee record. The form in the figure has three sections. Form sections are called blocks. The first section is the master block.