473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Static Methods in BLL

Hi;

I am developing an 3 tiered application. And my user interface is an ASP.NET
web application. My methods in BLL only uses own parameters and DAL. Now my
methods are not static. I heard that static methods are dangerous in ASP.NET
because ASP.NET applications are multi thread applications.
I use methods like that:
CustData cd = (new BLL.CustSystem()).GetCustomer(custid);
(new BLL.CustSystem()).UpdateCustomer(cd);
......
I review duwamish and I saw that it is like my application.

Can I make my methods static? Is it dangerous? If no, will it be better?

Thanks in advance.
--
______________________________
Åženol Akbulak
Nov 19 '05 #1
2 1852
Hi Senol,

Welcome to ASP.NET newsgroup.
As for the static class methods. I don't think they'll involve concurrent
issues unless you've explicitly implement them as context awared. Yes, the
ASP.net is a service application which will have multi concurent threads
running at the same time, however, this doesn't means that all the static
class methods will cause concurrent issu.e As for BBL components, I think
it is quite normal that we implement those operations as static class
methods since static methods's calling will have better performance than
constructor a new instance when using instance method.

Whether it'll cause concurrent issue dependes on how you implement your
static methods. If you make it context awared , for example define some
static variables which will be accessed concurrently, then we should take
care of that. Otherwise, it's ok to use static class methods.

In addition, in some large enterprise( NTIER) application, we create
separate BBL or DAL component instance to do operations because those
component may contains many context awared member datas such as transaction
or security context .... which are not convenient to maintain through
static methods.

Thanks,
Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 19 '05 #2
Selam senol,

It is not dangerous.I am using this type of architecture for 2,5 years.As
Steven said , if your functions are seperate from each other there is no
need to worry about.Also , your performence will be better.

"Þenol Akbulak" <se**********@newsgroup.nospam> wrote in message
news:44**********************************@microsof t.com...
Hi;

I am developing an 3 tiered application. And my user interface is an ASP.NET web application. My methods in BLL only uses own parameters and DAL. Now my methods are not static. I heard that static methods are dangerous in ASP.NET because ASP.NET applications are multi thread applications.
I use methods like that:
CustData cd = (new BLL.CustSystem()).GetCustomer(custid);
(new BLL.CustSystem()).UpdateCustomer(cd);
.....
I review duwamish and I saw that it is like my application.

Can I make my methods static? Is it dangerous? If no, will it be better?

Thanks in advance.
--
______________________________
Þenol Akbulak

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Axehelm | last post by:
Okay, I'm in a debate over whether or not static methods are a good idea in a general domain class. I'm personally not a fan of static methods but we seem to be using them to load an object. ...
4
by: Neil Zanella | last post by:
Hello, I would like to know whether it is possible to define static class methods and data members in Python (similar to the way it can be done in C++ or Java). These do not seem to be mentioned...
3
by: Steven D'Aprano | last post by:
I've been doing a lot of reading about static methods in Python, and I'm not exactly sure what they are useful for or why they were introduced. Here is a typical description of them, this one...
1
by: baylor | last post by:
In C#, an interface cannot mark any method as static. i'm told the ILASM supports it but i've never tested that Two questions. First, why? OK, i've heard the reason about interfaces being...
8
by: Steven Livingstone | last post by:
Anyone able to explain to me why you cannot define an interface that can then be implemented using static methods? I understand the C# CLS states this, but just interested in the reasons behind...
3
by: Mauzi | last post by:
hi, this may sound odd and noob like, but what is the 'big' difference between static and non-static funcitons ? is there any performace differnce? what is the best way to use them ? thnx ...
3
by: Jay | last post by:
Why are there static methods in C#. In C++ static was applied to data only (I believe) and it meant that the static piece of data was not a part of the object but only a part of the class (one...
8
by: Fernando Lopes | last post by:
Hi there! Someone has some code sample about when is recommend use a statis method? I know this methos don't want to be initialized and all but I want to know when I need to use it. Tks....
12
by: chandu | last post by:
hello, i want to know usage of static methods in a class. is it advantageous or disadvantage to use more static methods in a class. thank u
9
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
0
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,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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
0
BarryA
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...
0
marktang
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.