< Day Day Up > |
Using Fourth-Generation LanguagesSeveral fourth-generation languages (4GLs) are available at most IT shops . FOCUS, RAMIS, and NOMAD are examples of popular 4GLs. 4GLs, which operate at a higher level of abstraction than the standard 3GLs, can usually read, modify, process, and update data a set or a row at a time. For example, a 4GL can often issue a single command to list and display the contents of data stores. A 3GL program, in contrast, must read the data, test for the end of the file, move the data to an output format, and issue commands to control the display of a screen of data (for example, backward and forward scrolling, or counting the items per screen). Consider using 4GLs for two reasons. First, a single 4GL statement usually corresponds to many 3GL statements. Because this capability provides a quicker programming cycle, production applications are online faster than traditional 3GL-developed applications. Second, 4GLs have a greatly reduced instruction set, which makes them easier to learn and master than 3GLs. Be careful, though, because applications based on 4GLs rarely deliver the same level of performance as applications based on traditional languages. As with using pure SQL, writing entire applications using 4GL is uncommon but possible. More often, you will use 4GL to develop only certain components , such as
4GL Application GuidelinesApply the following guidelines to optimize your DB2-based 4GL development efforts. Avoid 4GLs When Performance Is CrucialAvoid coding performance-oriented DB2 systems using fourth-generation languages. You can usually achieve a greater level of performance using traditional, third-generation languages. Provide In-Depth 4GL TrainingIf you decide to use a 4GL, be sure that proper training is available. Although 4GLs can achieve results similar to 3GLs, they do not use the same techniques or methods . Developers unfamiliar with 4GLs usually do not produce the most efficient applications because of their tendency to use 3GL techniques or poorly developed 4GL techniques. Avoid Proprietary Storage FormatsWhen you're using 4GLs, try to query data directly from DB2 tables instead of extracts. Extracting the data into the (sometimes proprietary) format of the 4GL can cause data consistency problems. By avoiding extracts , you ensure that the data queried using the 4GL is consistent with the data queried using conventional DB2 and SQL methods. Extract Data As a Last ResortConsider moving the data from DB2 tables to the 4GL format only if the performance of the 4GL program is unacceptable. (You should consider this approach only as a last resort.) If data will be extracted from DB2, you must run a regularly scheduled extraction procedure to keep the 4GL data current. Use Embedded SQL If PossibleTo retrieve DB2 data, try to use SQL embedded in the 4GL rather than use the language of the 4GL. The reasons for doing so follow:
Join Tables Using SQL Instead of 4GLIf the 4GL provides a technique of relating or joining data from two physical data sources, avoid using it when accessing data from DB2 tables. Instead, create a DB2 view that joins the required tables, and query that view using the 4GL. This approach almost always provides better performance. For example, I converted one application using a 4GL "join" into a 4GL query of a view that joined tables. The application reduced elapsed time by more than 250 percent after the conversion. Understand the Weaknesses of Your Particular 4GLSome 4GL products interface to DB2 in unusual ways. Be sure that you understand the interface between the 4GL and DB2, as well as any potential "features" that could cause performance problems or management difficulties. For example, one 4GL I have worked with creates a DB2 view for every query issued via the 4GL. The management of these views can become troublesome as the number of queries issued using the 4GL grows. Understand the Strengths of 4GLUse the strong points of the 4GL and DB2. You should use DB2 to control the integrity of the data, the modification of the data, and the access to the data. You should use the 4GL to generate reports, perform complex processes on the data after it has been retrieved, and mix non-DB2 data with DB2 data. |
< Day Day Up > |