programming efficiency

Discussion in 'ASP General' started by gdp, Jan 24, 2004.

  1. gdp

    gdp Guest

    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
     
    gdp, Jan 24, 2004
    #1
    1. Advertising

  2. > single long script (around 5000 lines).

    5000 lines? We have entire full-service ASP applications that are half of
    this size, all pages included. Loading 5000 lines every time the user runs
    a page is going to bite you eventually, I guarantee it.

    The largest ASP script I've ever worked with was 250 lines, maybe. And it
    was completely self-supporting. Sounds like you should break apart your
    includes by functionality. For example, you don't need your connection,
    getRows() or paging helper functions on any ASP scripts that never touch the
    database.

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
     
    Aaron Bertrand [MVP], Jan 24, 2004
    #2
    1. Advertising

  3. gdp

    dlbjr Guest

    just include the file on all pages.

    On the first load the included page will be cached in ram.
    After that the page will load from Ram and perform great.

    Although, the logic would perform much better in a stored proc on the sql
    server and reduce the amount of data received from the sql server.


    -dlbjr

    Discerning resolutions for the alms
     
    dlbjr, Jan 25, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bryan Krone

    perl efficiency -- fastest grepping?

    Bryan Krone, Nov 5, 2004, in forum: Perl
    Replies:
    1
    Views:
    1,478
    Jim Gibson
    Nov 8, 2004
  2. Trevor Hartman

    dataset efficiency question

    Trevor Hartman, Jul 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    401
    Trevor Hartman
    Jul 3, 2003
  3. Joseph D. DeJohn

    Custom Paging Efficiency

    Joseph D. DeJohn, Aug 6, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    359
    S. Justin Gengo
    Aug 6, 2003
  4. MC D
    Replies:
    4
    Views:
    469
    Big D
    Nov 18, 2003
  5. =?Utf-8?B?R2VvcmdlIER1cnpp?=

    Regex Efficiency Q - Manipulating Html

    =?Utf-8?B?R2VvcmdlIER1cnpp?=, Feb 28, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    302
    =?Utf-8?B?R2VvcmdlIER1cnpp?=
    Feb 28, 2004
Loading...

Share This Page