i have two different vfp apps running at a client site.  one is a frontend desktop app that the
end-users use, and the other one is a backend maintenance app.  the maintenance app runs at night to do a set
of system maintenance jobs.  it has no
frontend and if there is anything needing attention, it will email the
technical support personnel for further investigation.

i developed these two apps separately, i.e. they belong to
two different projects.  in the
beginning, the maintenance app only did a few things, such as search and delete
temp files, check diskspace, etc.  over
time, more and more functions are added to it, and it became more intimate with
the internal logic of the frontend desktop app.

rather than duplicate code, i tried to share the common source
files between the two projects but the interdependence among those source files
force me to include more source files, and here and there need to add some
conditional logic to make them compile.

this smells ugly, and i now decide to bite the bullet to
integrate the maintenance app logic into the desktop app, so that all the
library routines in the frontend app are available to the backend app.  this integrated app runs dual mode, i.e. as a
frontend app or a backend app, probably depends on a command line switch.

i now begin to see the ease of maintenance - one project to
maintain, and one branch in the source tree! 
this will be the way to build future custom apps, at least for me that
is.

another way to do it is to build a third project housing the
common routines, but it is kind of late at this stage because a great deal of
refactoring may be required in order to extract those common routines into a
separate project.
 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *