Business Layer, Data Layer, Speed Issues, Classes, and all that

Discussion in 'ASP .Net' started by et, Mar 5, 2006.

  1. et

    et Guest

    In my asp.net 1 program, I have a business layer, which lays out all my
    business rules, and of course communicates with the data layer, which
    accesses a sql database and returns data. No problems.

    My program, however, is quite slow, and am wondering about instantiating the
    datalayer class from the business layer. Currently, in the business layer
    New subroutine, I declare the datalayer class and set it (Dim dl as
    MyDataLayer, dl = New MyDataLayer).

    Scrolling through Autos and Locals while debugging the program, I notice the
    entire datalayer constants, variables, everything, is loaded when I
    instantiate it, which I guess is the way it is meant to be. I am wondering
    if I would speed up if I instantiate the datalayer only when needed, within
    each business layer subroutine, then set dl = nothing immediately after each
    query. Am I causing more overhead and maintenance issues than if I just
    left it as is? Is there any benefit to this? In testing a small program, I
    didn't notice any difference, but am wondering if it would be worth it to
    try it in a large program.

    Thanks for your help.
    et, Mar 5, 2006
    #1
    1. Advertising

  2. et

    Terry Burns Guest

    Why not make your functions public shared functions, this way no
    instantiation is required.
    --
    Terry Burns
    http://TrainingOn.net

    "et" <> wrote in message
    news:...
    > In my asp.net 1 program, I have a business layer, which lays out all my
    > business rules, and of course communicates with the data layer, which
    > accesses a sql database and returns data. No problems.
    >
    > My program, however, is quite slow, and am wondering about instantiating
    > the datalayer class from the business layer. Currently, in the business
    > layer New subroutine, I declare the datalayer class and set it (Dim dl as
    > MyDataLayer, dl = New MyDataLayer).
    >
    > Scrolling through Autos and Locals while debugging the program, I notice
    > the entire datalayer constants, variables, everything, is loaded when I
    > instantiate it, which I guess is the way it is meant to be. I am
    > wondering if I would speed up if I instantiate the datalayer only when
    > needed, within each business layer subroutine, then set dl = nothing
    > immediately after each query. Am I causing more overhead and maintenance
    > issues than if I just left it as is? Is there any benefit to this? In
    > testing a small program, I didn't notice any difference, but am wondering
    > if it would be worth it to try it in a large program.
    >
    > Thanks for your help.
    >
    Terry Burns, Mar 6, 2006
    #2
    1. Advertising

  3. et

    et Guest

    Didn't know that, thanks!


    "Terry Burns" <> wrote in message
    news:...
    > Why not make your functions public shared functions, this way no
    > instantiation is required.
    > --
    > Terry Burns
    > http://TrainingOn.net
    >
    > "et" <> wrote in message
    > news:...
    >> In my asp.net 1 program, I have a business layer, which lays out all my
    >> business rules, and of course communicates with the data layer, which
    >> accesses a sql database and returns data. No problems.
    >>
    >> My program, however, is quite slow, and am wondering about instantiating
    >> the datalayer class from the business layer. Currently, in the business
    >> layer New subroutine, I declare the datalayer class and set it (Dim dl as
    >> MyDataLayer, dl = New MyDataLayer).
    >>
    >> Scrolling through Autos and Locals while debugging the program, I notice
    >> the entire datalayer constants, variables, everything, is loaded when I
    >> instantiate it, which I guess is the way it is meant to be. I am
    >> wondering if I would speed up if I instantiate the datalayer only when
    >> needed, within each business layer subroutine, then set dl = nothing
    >> immediately after each query. Am I causing more overhead and maintenance
    >> issues than if I just left it as is? Is there any benefit to this? In
    >> testing a small program, I didn't notice any difference, but am wondering
    >> if it would be worth it to try it in a large program.
    >>
    >> Thanks for your help.
    >>

    >
    >
    et, Mar 6, 2006
    #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. dan
    Replies:
    25
    Views:
    1,316
    Uncle Bob (Robert C. Martin)
    Oct 28, 2003
  2. java-john
    Replies:
    0
    Views:
    522
    java-john
    Mar 23, 2006
  3. Dhananjay
    Replies:
    1
    Views:
    1,097
    sloan
    Dec 18, 2006
  4. SAL
    Replies:
    9
    Views:
    504
    Steven Cheng[MSFT]
    Jan 14, 2008
  5. Deodiaus
    Replies:
    2
    Views:
    538
    Vladimir Jovic
    Oct 13, 2010
Loading...

Share This Page