Managing Source Code
When working on a large G2 project, especially in a team development environment, you will naturally build up several copies and versions of the source code. Managing the various copies and versions of the code is the focus of source code control (SCC).
Commercial Source Code Control System Features
Many commercial systems for SCC exist, most of which provide the following functionality:
Using SCC Systems with G2
G2 applications present certain challenges for SCC systems:
Because of these factors, it is not possible to use the differencing or dependency tracking features of commercial SCC systems. Additionally, the backup and version control systems usually must store the entire KB file, instead of just incremental changes, each time the KB is saved. Despite these limitations, SCC is still essential for managing G2 team development projects.
Note: Within the G2 5.x timeframe, G2 will support text-based KB files, which are not encrypted and will work effectively with most source code control systems.
Essential Features of G2 Source Code Control
The essential functions of an SCC system for modular KB development are:
Even when a commercial SCC system is not available, a competent system programmer can create a SCC system that provides these functions.
Using G2 Facilities for Source Code Control
Because SCC systems cannot provide information about what has changed in a KB, G2 provides several facilities for recording incremental changes:
The change logging feature records the entire text of items such as procedures whenever you make a change. However, change logging only records incremental changes to class definitions, rules, and other small items.
Other Techniques for Source Code Control
Another technique you can use to manage source code is to create a procedure that writes all your methods and procedures to a file and then to compare the text of the file with earlier versions.
In addition, you might consider creating your own user menu choice for deleting an item or saving the KB, which checks the timestamp of the last module that was saved and warns you if a newer version of the module exists.
You can also use GFR to manage module versions and keep track of which versions the application requires to run.
For more information on using GFR for version control, see Version Control.
Copyright © 1997 Gensym Corporation, Inc.