Вы находитесь на странице: 1из 12

Module

1
Informix-4GL and the Informix Toolset

Objectives
At the end of this module, you will be able to:
„ Explain to others how Informix-4GL fits into the client/server
architecture of Informix products
„ Tell the difference between the compiled Informix-4GL C Compiler
Version and Informix-4GL Rapid Development System.

Informix-4GL and the Informix Toolset 1348 07-99 1-1


 2000 Informix Software, Inc.
4GL and Client/Server Architecture

Informix
Server Server

SQL
Client 4GL

Informix-4GL and the Informix Toolset 1348 07-99 2

Theoretically, an end user could manipulate databases using a query language.


Informix-4GL allows you to both provide a far friendlier mode of interaction, and
protect valuable data from end user errors.
Because of its role in the client/server architecture, the 4GL code you write is
actually a 4GL/SQL hybrid. It contains:
„ 4GL logic for screen handling and the user interface.
„ SQL statements which are sent to the Informix Server to be processed.

Informix-4GL and the Informix Toolset 1-2


Compiling Informix-4GL
MAIN
4GL code
END MAIN P-Code

Source Runable
file.4gl file.4go/file.4gi

Informix-4GL RDS Time Line

#include #include #include


<sqlhdr_h>
#&!(!($($%*
<decimalh> <decimalh>
#include $%*!(($%(%
#include #include
<sqlfm_h> *($%*$%(#$
<stdioh> <stdioh>
MAIN #line 1 (#$(#%)(#%
$extern $extern
4GL code “test.ec” *(#%(#%(# Machine
struct { #include
END MAIN %(#%( Binary
long
Extended
Source ESQL/C ESQL/C C Code Object Executable
file.4gl file.4ec file.ec file.c file.o file.4ge

Informix-4GL Compiled Time Line


Informix-4GL and the Informix Toolset 1348 07-99 3

There are actually two versions of Informix-4GL: Informix-4GL Rapid


Development System (RDS) and Informix-4GL C Compiler version. Both
products code the same way and use the same Informix-4GL statements.
What is the Difference?
One difference is in the compilation phase. After you have coded a module, that
module must be compiled and linked to other modules. This process of compilation
is different for the two types of Informix-4GL.
Rapid Development System
As can be seen in the diagram above, RDS compiles into pseudo-code (p-code).
Notice that the time line for compiling into p-code is very small. One of the reasons
it is called Rapid Development System is because the compilation time is
dramatically reduced.
C Compiler Version
The compile time for the C Compiler version of the product, often called Compiled
Informix-4GL, is substantially longer. The Informix-4GL code is first translated into
ESQL/C code, then C code, then object, and then into an executable program.

Informix-4GL and the Informix Toolset 1-3


So, I Will Use Informix-4GL RDS, Right?
From what you have seen, it looks like there is no reason not to use Informix-4GL
RDS. Before you make up your mind completely, let us look at how the types of
classic Informix-4GL execute after they have been compiled.
Note For more information on the file extensions shown in the slide, see Volume One,
Chapter 1 of the Informix-4GL Reference Manual. The module explains in more
detail how object files are concatenated and how backup files are produced
automatically when you use the Programmer's Environment.

Informix-4GL and the Informix Toolset 1-4


Running Informix-4GL

Informix-4GL and the Informix Toolset 1348 07-99 5

There is another difference between the two types of Informix-4GL. This


difference is in how they are executed.
Rapid Development System Execution
The p-code generated by the Informix-4GL RDS is not directly executable by the
computer. It must be executed through a p-code runner. The runner takes the
statements that you have written in Informix-4GL and translates them at runtime into
something the computer can understand. As you can see by the diagram above,
Informix-4GL RDS can take longer to execute. How much longer depends on the
type of hardware you are using and what the actual Informix-4GL code is doing. You
may not notice any difference at all.
Compiled Informix-4GL Execution
With the Compiled Informix-4GL, the execution time of the finished program is
faster than the p-code generated by Informix-4GL RDS. This is because the
compilation sequence for this type of Informix-4GL takes the code you have written
and translates it directly into machine executable code.

Informix-4GL and the Informix Toolset 1-5


So I Will Use Compiled Informix-4GL, Right?
All developers want their code to execute quickly, so you might be willing to trade
the speed of compiling for the speed of execution. Before you make up your mind,
let us examine some facilities that are only available with RDS.

Informix-4GL and the Informix Toolset 1-6


Informix-4GL Interactive Debugger

The Debugger is
available with
RDS.

Informix-4GL and the Informix Toolset 1348 07-99 7

The INFORMIX-4GL Interactive Debugger can only be used with the


INFORMIX-4GL Rapid Development System. The Debugger can be used to trace
runtime bugs in your source code. The Interactive Debugger allows you as much
control over your program as you need:
„ You can actually watch the code you have written as it executes, stopping it at
any time along the way.
„ You can trace variables so that the execution will stop whenever the value of a
variable changes.
„ You can step through the execution line by line, look at the value of a program
variable at any time, and use a host of other commands.

Informix-4GL and the Informix Toolset 1-7


Weighing the Difference

Interactive
Performance
Debugger
Consideration
Informix-4GL Rapid
Development System Informix-4GL
C Compiler Version

Informix-4GL and the Informix Toolset 1348 07-99 8

One might suppose that the speed of execution looks like it outweighs the speed of
development. However, the INFORMIX-4GL Rapid Development System is
compatible with the Interactive Debugger, which could put it over the top for you.
The Best of Both Worlds
The choice is yours. The most efficient solution would be to have both
implementations running on your system. You can develop your application using
Informix-4GL RDS and then compile the finished product using Compiled
Informix-4GL. Remember the actual Informix-4GL code is the same in both
products.

Informix-4GL and the Informix Toolset 1-8


Informix Dynamic 4GL
„ Automatic GUI interface for existing character applications
„ Fully graphical, three-tier, thin-client architecture
„ Java or HTML client for Web
„ 100% source compatible with Informix-4GL

Informix-4GL and the Informix Toolset 1348 07-99 9

The product Informix Dynamic 4GL is a superset of Informix-4GL which enables


you to:
„ Deploy existing, mature, robust Informix-4GL applications to a variety of new
computing environments, including simultaneous support for Windows, X-
Windows, and Web clients, as well as UNIX or Windows NT application
servers.
„ Employ a fully graphical, three-tier thin-client architecture while taking
advantage of the higher performance and scalability of Dynamic 4GL’s
completely re-designed development and runtime components.
„ Leverage either the Java client or the HTML client to bring Dynamic 4GL
applications to a web environment.
„ Retain and extend existing applications, as Dynamic 4GL is 100% source
compatible with Informix-4GL.

Informix-4GL and the Informix Toolset 1-9


True or False

It is called the Rapid Development System


because it compiles faster. __________
You can use the Interactive Debugger with
the C Compiler version of Informix-4GL.
__________
You use the same statements to write your
application, regardless of the implementation
of Informix-4GL you are using.
__________
Dynamic 4GL is 100% source compatible
with I-4GL. __________

Informix-4GL and the Informix Toolset 1348 07-99 10

Classify the statements shown above as true or false.

Informix-4GL and the Informix Toolset 1-10


Solutions
True or False Solutions

It is called the Rapid Development System


because it compiles faster. T
____
You can use the Interactive Debugger with the
C Compiler Version of Informix-4GL. F
____
You use the same statements to write your
application, regardless of the implementation of
Informix-4GL you are using. T
____
Dynamic 4GL is 100% source compatible with I-
4GL.
T

Informix-4GL and the Informix Toolset 1348 07-99 12

The solutions to the true or false statements are shown above.

Informix-4GL and the Informix Toolset 1-12

Вам также может понравиться