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. 2 1307
Why not make your functions public shared functions, this way no
instantiation is required.
--
Terry Burns http://TrainingOn.net
"et" <ea*************@yahoo.com> wrote in message
news:OU*************@tk2msftngp13.phx.gbl... 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.
Didn't know that, thanks!
"Terry Burns" <me@mine.com> wrote in message
news:eB**************@TK2MSFTNGP12.phx.gbl... Why not make your functions public shared functions, this way no instantiation is required. -- Terry Burns http://TrainingOn.net
"et" <ea*************@yahoo.com> wrote in message news:OU*************@tk2msftngp13.phx.gbl... 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.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Natan |
last post by:
I want to create an n-tier app and I would like an advice of you that
know more than me about this.
I want my app to support multiple databases in the way that when a
client wants to use Oracle...
|
by: newbie |
last post by:
Hello,
If I have posted the question in the wrong group, I apologize.
I am building a windows application (in c#) that will be interacting
with an existing Access database. This database will...
|
by: Andy |
last post by:
Hi all,
I'm building various tiers to support multiple applications. I will
have the data layer, business layer, and serveral UI layers.
Currently I have a Data class when represents a single...
|
by: laimis |
last post by:
Hey guys,
I just recently got introduced to data mappers (DTO mapper). So now I
have a SqlHelper being used by DTOMapper and then business layer is
using DTOMapper when it needs to persist...
|
by: Brian Henry |
last post by:
I was wondering how you guys would handle filling a list view with something
like 10,000 items which each have 10 sub items on them... there has to be
major speed issues with that right? Yet,...
|
by: headware |
last post by:
I'm relatively new to ASP.NET and ADO.NET, but I have a basic design
question regarding the use of web services and APS.NET applications.
Right now we have an application that uses web services to...
|
by: Ily |
last post by:
Hi all
I am using Visual studio 2005.
Im my project I have a presentation layer, a business layer and a data
access layer. From my business layer i have a reference to my data
layer. I also...
|
by: Dhananjay |
last post by:
hello everyone
i have got a problem i want to design business layer, data access layer
, presentation layer for asp.net using C#.net , can anyone help me to
solve this problem. i want some...
|
by: SAL |
last post by:
Hello,
I have a Dataset that I have table adapters in I designed using the designer
(DataLayer). I have a business logic layer that immulates the DataLayer
which may/may not have additional logic...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| | |