hi
could i please have some opinion on how efficeint or otherwise my
programming method is.
i have just finished a project for there are six different departments at
the client all using similar management information screens. this is a web
application written in vbscript and using SQL server. the views they have
of the data are similar but not exactly the same. because there are many
calculations (some dealing with invoicing) involved i wanted to only have
one bit of code that did any one thing. these bits of code were done as
subs and functions which were passed many parameters when called. if a
particular department needed slightly different views that would be detailed
in the parameters passed. this way the logic is in only one place and if a
calculation is wrong it gets fixed just once. all well and good....but.
the different departments all have their own directory within the client
directory and i also have a directory called COMMON_LIBRARY where i put a
single long script (around 5000 lines). this script contains all the logic
described above for the whole system. each department directory contains
and script called MAIN which contains "flow" logic for the system. each
page passes form or querystring variables inluding one called SYSSTATE whic
tells the MAIN script what is being done. MAIN contains a big select case
on SYSSTATE and the individual pages are set as includes
eg
select case SYSSTATE
case 1
%>
<!--#include file="do-this.asp" -->
<%
case 2
%>
<!--#include filedo-that.asp" -->
<%
....etc....
the big logic script containing all the subs and funcs that are called from
the includes is also included in this MAIN script.
my worry is....doing it this way, every time I load a page on the system I
am loading all the lines in the COMMON_LIBRARY script, the MAIN script and
also all the includes it contains...this is a lot of code and all the
particular page may be doing is asking the user to fill in their login name
and submit it.
it does not seem a slow system to use and it has been in use for a few weeks
now but it "feels" like a bad way to do it. i really like, however, having
this one source of logic that just gets put in everything. i know that all
my routines are there to do anyhting the system needs to and also that i
have a single point of change for debugging.
any thoughts????
thanks
gdp