Copyright © 2007 SoftVelocity, All rights reserved worldwide

Cloning Master Programmers' Code

Because the basis of the Clarion templates is the Clarion language itself, any business with a master programmer, i.e., one who has studied and become familiar with the Clarion language, can develop their own templates for use by other programmers.

The master programmer, in preparation for writing a new template, writes the source code with the functionality that they wish to clone. The developer examines the code and isolates all the references to tables and columns in the current database. At design time, the development environment will display a list of tables and fields so that the less experienced programmer can choose a database table or field from their project, to substitute for the original from the template programmer's project. In other words, the templates aren't tied to a specific database schema.

The template designer also creates the template interface, which will prompt the user to supply whatever values are necessary to customize the code's behavior. The illustration below shows the template interface for a standard update form:

The programmer can add whatever template control statements are necessary to correctly generate the code. If, for example, the template needs to generate code for every control in the window, then the programmer adds the template instructions that instruct the Application Generator to loop through all the controls and generate the code substituting each control variable within each line of generated code.

Templates promote code reuse and centralized maintenance of code. They provide many of the same benefits of object oriented programming, especially reusability. In addition, templates can compliment and enhance the use of object oriented code by providing easy-to-use wrappers for complex objects. The standard Clarion templates are a prime example of this synergistic relationship between templates and objects.


Education

Our Training OnDemand course, Course V —Template Language Series,
offers an in-depth look into Clarion template writing. Click here for details.

 

 

 

 


Copyright © 2007 SoftVelocity, All rights reserved worldwide