Week 1 January 25 •Introduction to 4GLs •4GLs versus 3GLs
Download
Report
Transcript Week 1 January 25 •Introduction to 4GLs •4GLs versus 3GLs
Week 1
January 25
•Introduction to 4GLs
•4GLs versus 3GLs
•File-based systems versus database
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
1
User
Interface
Interface
PowerBuilder 4GL Model
Process
Data
Program
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
2
File-based
Interface
Interface
Conventional File-Based Applications
User
Process
Data
Text
Procedural
Records
• 80 x 24 Screen • 3GL program • Files
• Characters
• Hierarchical database
• Function keys
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
3
Text-Based Interactive Application
Press function key
corresponding to a
menu option
Enter letters
corresponding to a
menu options
Function
keys
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
4
File-Based System
Customer
Order File
PO Program
Invoice
One file, one program, one output
Customer
Account
File
Customer Accounts
Program
Customer
Mailing
List File
Customer Mailings
Program
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
Account
Report
Mailing List
5
File-Based Systems
• Records contain logically related data
• Limitations:
– Separation and isolation of data
– Duplication of data
• Loss of data integrity
– Data dependence
– Incompatibility of files
– Fixed queries/proliferation of application programs
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
6
Data Redundancy
• Customer Order File
– PO number
– Customer account number
– Customer name, address, city, state, zip code
– Order date
– Product code, product description, price, unit
• Customer Account File
– Account Number
– Customer name, mailing address, city, state, zip code
• Customer Mailing List File
– Customer name, mailing address, city, state, zip code
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
7
•
•
•
•
Interface
Interface
4GL Applications
Database
User
Process
Data
GUI
Event Driven
Set
Windows
• Code
Objects
Pictures and graphics
Point and click
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
• RDBMS
8
Oracle Developer Applications
User
Query
Process
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
Interface
Interface
Data
Data
9
Oracle Developer Applications
Presentation
Data Source
Account #:
User
• Reports
• Forms
• Graphs
Interface
Interface
File
Process
Data
• Triggers
(PL/SQL)
• Query
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
10
Database
• “A shared collection of logically related data (and a
description of this data), designed to meet the information
needs of an organization.”
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
11
Database
Management
Queries
Customer
Orders
DBMS
Order Items
Application
Programs
Products
Manufacturers
Central Repository
• DDL
Other
• DML
• Controlled access Software
Single Access
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
Multitude of
Applications
12
Data Abstraction
• Separation between the data’s structure (definition) and the
application programs
In a procedural language program such as COBOL...
FD Master-File.
01 Master-Record.
05 ID
05 Customer-Fname
.
.
.
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
Tightly binds the
data file and
PIC X(10).
program
PIC X(25).
13
Data Abstraction
• Separation between the data’s structure (definition) and the
application programs
In a procedural language program such as COBOL...
Data
FD Master-File.
OutputTightly binds the
01 Master-Record. Program
data file and
05 ID
PIC X(10).
program
05 Customer-Fname PIC X(25).
.
.
.
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
14
Data Abstraction
• Separation between the data’s structure (definition) and the
application programs
Data and data definitions
Database
Application
Application
Application
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
15
Advantages of the Database Approach
• Reduced redundancy
• Data consistency
• Greater informational gain
– Better access to data and information
• Improved data integrity
• Improved access and security
• Enforcement of standards
• Easier modification and updating
• Data and program independence
• Standardization of data access
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
16
Disadvantages of the Database Approach
•
•
•
•
•
•
•
Complexity
Size
Cost of DBMS
Additional hardware costs
Cost of conversion
Performance
Higher impact of failure
Stair, 1995
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
17
What is a Fourth Generation Language
(4GL)?
• ...a programming language that is less procedural and more
English-like than third generation languages. It
emphasizes what is to be done more than how statements
are to be written.
Stair, 1995
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
18
For example...
COBOL
OPEN INPUT EMPLOYEE-FILE.
READ EMPLOYEE-FILE.
PERFORM WHILE NOT EOF
IF EMP-ID = SEARCH-KEY
DISPLAY EMP-ID " "
EMP-FIRST-NAME " "
EMP-LAST-NAME " "
EMP-YTD-PAY
END-IF
READ EMPLOYEE-FILE
END-PERFORM.
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
Three Control Structures:
• Sequence
• Iteration
• Decision
19
Control Structures
COBOL
OPEN INPUT EMPLOYEE-FILE.
READ EMPLOYEE-FILE.
PERFORM WHILE NOT EOF
IF EMP-ID = SEARCH-KEY
DISPLAY EMP-ID " "
EMP-FIRST-NAME " "
Sequence
EMP-LAST-NAME " "
EMP-YTD-PAY
END-IF
READ EMPLOYEE-FILE
END-PERFORM.
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
20
Control Structures
COBOL
OPEN INPUT EMPLOYEE-FILE.
READ EMPLOYEE-FILE.
PERFORM WHILE NOT EOF
IF EMP-ID = SEARCH-KEY
DISPLAY EMP-ID " "
EMP-FIRST-NAME " "
Iteration
EMP-LAST-NAME " "
EMP-YTD-PAY
END-IF
READ EMPLOYEE-FILE
END-PERFORM.
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
21
Control Structures
COBOL
OPEN INPUT EMPLOYEE-FILE.
READ EMPLOYEE-FILE.
PERFORM WHILE NOT EOF
Condition
IF EMP-ID = SEARCH-KEY
True
DISPLAY EMP-ID " "
EMP-FIRST-NAME " "
Decision
EMP-LAST-NAME " "
EMP-YTD-PAY
END-IF
READ EMPLOYEE-FILE
END-PERFORM.
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
False
22
What as Opposed to How
How to What
COBOL
SQL
OPEN INPUT EMPLOYEE-FILE.
READ EMPLOYEE-FILE.
SELECT EMP-ID,
PERFORM WHILE NOT EOF
EMP-FIRST-NAME,
IF EMP-ID = SEARCH-KEY
EMP-LAST-NAME,
DISPLAY EMP-ID " "
EMP-YTD-PAY
EMP-FIRST-NAME " "
FROM EMPLOYEE
EMP-LAST-NAME " "
WHERE EMP-ID=1234
EMP-YTD-PAY
END-IF
READ EMPLOYEE-FILE
END-PERFORM.
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
23
Characteristics of 4GLs
• User friendly
– Less syntax-bound
– Fewer programming skills required
• Non-procedural
– Emphasis is on what (outs are desired) rather than how
(programming statements should be written)
– Shorter application development time
• GUI (graphical user interface)
– Incorporate the use of the mouse (point and click)
– Involve the use of icons
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
24
Characteristics of 4GLs
• Function-based
– User calls upon pre-programmed functions
• Specifies the arguments and parameters which
define the scope of the results
– Graphical or tabular output
• Popular for developing client/server applications
– Toted as client/server solutions
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
25
Other Characteristics
Applicable to Today’s 4GLs
• Menu driven
• Database oriented
– Embedded query commands (e.g., SQL)
• Retrieval focused
– Query capabilities
• Human factors designed
Martin, 1991
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
26
Menu object
Graphic background
Event-driven command buttons
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
27
SQL
statement
retrieves
customer
data
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
28
4GLs: Pros and Cons
• Good for ad hoc and nonrecurring reporting
– One-time information reporting
• Good for prototyping and end-user computing (EUC)
application development
– Discovering specifications (prototyping)
– Developing and implementing single-user applications
(EUC)
– Short learning curve
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
29
4GLs: Pros and Cons
• Poor computing efficiency
– Not appropriate for
• Processing voluminous amounts of data
• Transaction processing
• Scheduled reporting
• Difficult to enforce organizational computing standards
• Very difficult to debug
• Very difficult to maintain
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
30
Oracle Developer
• Forms (interactive)
– Presenting information and entering data online
• Reports (reporting)
– Page-oriented display of information
• Graphics (charts)
– Graphic representation of data
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
31
R. Ching, Ph.D. • MIS Dept. • California State University, Sacramento
32