Programmer's Procedure to Add a Data Field
Adding a data field involves changing the documentation and program modules as well as the affected table in the database. Since this involves changes in the database and the perl program modules, this procedure is aimed at programmers.
It is important that all these steps be done more or less at the same time. The documentation must be updated to reflect the new features and how to use them. And, the code must be implemented.
The general procedure to add a field to any table is generally the same regardless of the field or table. This is the procedure.
-
Determine the table and field name(s). Be sure the field names are unique in the table.
-
Access phpMyAdmin in the host control panel: Login >> MySQL Administration >> phpMyAdmin.
-
Add the field(s) after the last field in the table regardless of semantics or logical order within the table to minimize the amount of rework in the code.
-
Update the data tier program module. This module is normally the table name preceded by "Jsh", all lower case. E.g. if the table is "abc" the module name will be Jshabc.pm.
-
Add subs to get the new field(s) from the row.
-
Make any needed changes to the add and update subs.
-
Add a parm to the JshPARM.pm to hide the new field from users that won't be using the new field.
-
Update on the application tier module. This module is normally the table name followed by "s" and ".pl", all lower case.
-
Add displayed fields to view_row and edit_form. Put fields where they make sense to the user.
-
Add input fields, as needed, to new_row_form and edit_form. Match the sequence in the previous step.
-
Make any needed changes to the add and update subs.
-
Consider the application as a whole and think if any additional changes are needed. Make changes and fix the implementation as needed.
This procedure is abbreviated and high level. It is documented to prompt the programmer as to the needed steps and is not intended to be a detailed step-by-step procedures.
|