The purpose of this is to make RAD both very easy and very efficient,
by increasing its sophistication. It can also make it easier to do
custom builds.
It selectively merges portions of template files,
line-by-line, based on features
selected in a project configurer. This means for example,
that, in a specially
designed editor, line 12 could be from one file, line 13 from a second
file and
line 14 from a third file. The degree of file mixing can be as complex
as needed.
It will also support insertion of lines generated dynamically for
occasions where
option flags need to be ORed together for example.
Below is an
example of intricately merged code. The
background colors
are there to help illustrate the idea (see
the "legend" inset).
Each
category of code is stored in a separate template file.
Each line of template code has a unique label and a link to
its appropriate
insertion position (the core template code would never be linked).
The line labels and links are attached to the ends of the lines for the
sake
of neatness.
The labels are generated automatically by an algorithm which
combines
the
file names with hex numbers which are spread out over a range of about
4 billion.
This is to make sure it's easy to add lines of code without breaking
links in other
template files. Example of a label: "CORE:E1958B2C"
By giving each line of template code a unique label, features
can be
added
and removed freely at any time, without losing track of where they
belong.
Selecting a type of code functionality will cause the code it requires
to be
inserted at any number of preset places as needed. For example,
selecting
image support would do something like: 1) Insert a
procedure for loading and displaying images 2) Insert
"OleInitialize 0" in the WM_CREATE message handler 3) Insert
image refresh code in the WM_PAINT message handler 4) Insert
"OleUninitialize" in the WM_DESTROY message handler
The programmer's code can be associated with specific code
categories
line-by-line, so that it can be freely removed and added back to a
project
along with the template code category it's associated with.
The template code is planned to have extensive,
self-monitoring,
self-configuring,
self-optimization and self-debugging features.
The Editor
The editor portion of this project will support
editing of multiple files which have
been intricately merged
in this way. This will also make
template creation easier.
It will keep track of the line
labels and
(optionally) protect lines of template code
from editing. It
will also control how line
labels are displayed or suppress them
altogether.
Building a
Template-Based Project
When building a
template-based project, the lines of code from the
project are
combined into one or more normal source files. Until this, all the
lines of code
are kept in their separate files.
The greatest difficulty will likely be designing a configurer
with uniform, intuitive
interfaces for all the code categories.
This concept was originally tried (successfully) with equates
and
conditional
compile directives, but that got messy quickly.