E
et
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.
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.