Progress Programming Tips
By Rod Gaither (rdg@worldinfo.com)
PPT-7 Import and Export for saving incomplete data
Tip:
An area of database and application design that I find gets
mishandled often is the need for application specific mandatory
data. On the one side you want your database to be as rigorous
as possible when enforcing validation and mandatory requirements. On
the other your application needs to be forgiving to the user during
the data entry process. These two are very much at odds within
complex systems. If I have all but one piece of mandatory information
should I be forced to undo the data entered so far? Not from the
user's point of view I can tell you!
There are several ways to deal with this issue. The ideal
solution is to allow a user to save "incomplete" data without
that data getting into the real application data. Now the
question is how.
I propose a system that has a general table to manage
identification of these temporary records - by module, type, etc. and
points to the location of the export text file. Some very generic
procedures can be used to view and select from the temporary records
available and then use an import to bring back the data into the
application so it can be finished and validated through normal
processing. The user doesn't lose their work, and the system can
maintain high validation standards.
The downsides to this are the data is external to the
application. It could be deleted or have visibility problems
if it was sensitive data.
Other options are -
1. You can use the real table with some sort of flag.
The problem with this is your entire application needs to know
how to avoid this data. In this age of third party reporting
tools this gets even more difficult.
2. You can store the data in some sort of packed or generic table in
the database.
This is ok but requires dealing with the static nature of field
references. This may not be such an issue with the upcomming
replication features but previously this required considerable
code or code generation efforts.
3. You can connect to a special temporary database that acts as a
shadow db only used for such purposes.
Again, not too bad, and actually helpful if you need to share
these temporary records for others to complete. It does still
impose admin and maintenance headaches though as well as a fair
amount of application code awareness.
Wisdom:
Programming is a fine art. It requires patience, practice, creativity
and talent. Sometimes three out of four is enough.
Rod Gaither | rdg@worldinfo.com
World Information Systems | (910) 333-2580 Voice
Greensboro, NC | (910) 333-2584 Fax