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

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.
 
T

Terry Burns

Why not make your functions public shared functions, this way no
instantiation is required.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top