473,385 Members | 2,005 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.

N-Tier Application - Question about Static Methods

dn
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.
Dec 14 '05 #1
15 2133

"dn" <no****@company.com> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer,
a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.


We're currently building a SOA system right now and we use a combined model
in the Business Facade.
class Customer
{
public int Id;
public string Name;
public static Customer GetCustomer(int id)
{
SomeData data = /* fetch data some how. */

Customer c = new Customer();
c.id = id;
c.Name = data.Name;
return c;
}
}

First time we tried this approach and we really like it. The Customer is its
own Factory.
But most often our classes is a typed DataSet and then you get your class by
clicking away in vs2005.

- Michael S


Dec 14 '05 #2
Static methods are useful when you dont' need access to any member in the
class in which the methods are created. The reason for this is simply saving
memory. An instance method is a method which is included in an instance of a
class. When the class is instantiated, a copy of the class is placed on the
stack. This means that, for every copy of the class, a copy of the method is
created. A static method remains in the heap; there is only one instance of
it. So, if the method does not need to access any instance members of the
class, it can be a static method, and save memory. It *can* access other
static members of the class, or any other static members of any class that
is accessible to it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"dn" <no****@company.com> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer,
a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.

Dec 14 '05 #3
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Static methods are useful when you dont' need access to any member in the
class in which the methods are created. The reason for this is simply
saving memory. An instance method is a method which is included in an
instance of a class. When the class is instantiated, a copy of the class
is placed on the stack. This means that, for every copy of the class, a
copy of the method is created. A static method remains in the heap; there
is only one instance of it. So, if the method does not need to access any
instance members of the class, it can be a static method, and save memory.
It *can* access other static members of the class, or any other static
members of any class that is accessible to it.

--
HTH,

Kevin Spencer


Boy, do you have some learning to do.. You are wrong on all accounts.

- Michael S
Dec 14 '05 #4

dn wrote:
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.


The question of using static methods does not depend on the layer.
1. Static method usually provide functionallity which are not instance
related.
They can be used for creating instances (factories), converting
purposes (System.Convert), or other useful things with instances
(String.Concat).

2. The strategy to use this for an application design (let's say
factories should create biz objects) works fine with static methods.
Why ? Because the design of the factory pattern makes it useful the
have functionality which has no direct relation to an instance of that
particular factory.

I hope this helps
cheers, Marcus

Dec 14 '05 #5
Good argument Michael.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Michael S" <no@mail.com> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Static methods are useful when you dont' need access to any member in the
class in which the methods are created. The reason for this is simply
saving memory. An instance method is a method which is included in an
instance of a class. When the class is instantiated, a copy of the class
is placed on the stack. This means that, for every copy of the class, a
copy of the method is created. A static method remains in the heap; there
is only one instance of it. So, if the method does not need to access any
instance members of the class, it can be a static method, and save
memory. It *can* access other static members of the class, or any other
static members of any class that is accessible to it.

--
HTH,

Kevin Spencer


Boy, do you have some learning to do.. You are wrong on all accounts.

- Michael S

Dec 14 '05 #6
static methods are made for use in things like int.Parse(string s)
(stuctures and very simple datatypes) but not for use in business layers!!!

it may now be easy to use them but in time you will pay for that when
your system seems to be very hard to maintain.

read the following two documents!
http://msdn.microsoft.com/practices/.../html/daag.asp
and
http://msdn.microsoft.com/practices/...tml/boagag.asp

these will give you excellent information on how to build business
layers and data layers

greetz Dries

dn wrote:
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.

Dec 14 '05 #7

"Kevin Spencer" wrote:
Static methods are useful when you dont' need access to any member in the
class in which the methods are created. The reason for this is simply saving
memory. An instance method is a method which is included in an instance of a
class. When the class is instantiated, a copy of the class is placed on the
stack. This means that, for every copy of the class, a copy of the method is
created. A static method remains in the heap; there is only one instance of
it. So, if the method does not need to access any instance members of the
class, it can be a static method, and save memory. It *can* access other
static members of the class, or any other static members of any class that
is accessible to it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"dn" <no****@company.com> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer,
a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.



All Objects of a Class Share Just One Copy of Each Instance Method

Because each instance method is executed in relation to a specific object,
it seems that there exists one particular instance method copy in the memory
per object. However, this is not the case, because it would consume far too
much memory. Instead, all objects of the same class share just one copy of
each instance method.

The Rocket class shown next illustrates this point. Two Rocket objects are
created and their references assigned to rocketA and rocketB, respectively
(lines 30 and 31). Even though there is only one copy of the Launch method,
rocketA.Launch() (line 40) still executes Launch in relation to rocketA, and
rocketB.Launch() (line 41) executes Launch in relation to rocketB.

01: class Rocket
02: {
03: private double speed;
...
10: public void Launch()
11: {
...
15: speed = 3000.9;
...
20: }
...
25: }

30: Rocket rocketA = new Rocket();
31: Rocket rocketB = new Rocket();

40: rocketA.Launch();
41: rocketB.Launch();

How can C# make this possible? The compiler secretly passes the reference of
the object for which the method is called along as an argument to the
instance method. If you could look down into the engine room of the compiler,
it might look like the following lines:

Rocket.Launch (rocketA);
Rocket.Launch (rocketB);

The compiler then (also secretly) attaches the object reference to any code
inside the method that is specific to the object. For example, during the
Rocket.Launch(rocketA) call, the following line

speed = 3000.9

becomes equivalent to

rocketA.speed = 3000.9

Dec 14 '05 #8
Thanks Jesika. I stand corrected. Good stuff.

--

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Jesika" <Je****@discussions.microsoft.com> wrote in message
news:15**********************************@microsof t.com...

"Kevin Spencer" wrote:
Static methods are useful when you dont' need access to any member in the
class in which the methods are created. The reason for this is simply
saving
memory. An instance method is a method which is included in an instance
of a
class. When the class is instantiated, a copy of the class is placed on
the
stack. This means that, for every copy of the class, a copy of the method
is
created. A static method remains in the heap; there is only one instance
of
it. So, if the method does not need to access any instance members of the
class, it can be a static method, and save memory. It *can* access other
static members of the class, or any other static members of any class
that
is accessible to it.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"dn" <no****@company.com> wrote in message
news:Oo**************@tk2msftngp13.phx.gbl...
> I'm starting an n-tier application with an ASP.NET 2.0 presentation
> layer,
> a
> business layer, a data access layer, and a SQL Server 2005 database,
> and I
> have a question.
>
> In the business and data access layers, should I use static methods?
> Or,
> should I code the classes so that they have to be instantiated? I've
> seen
> examples of both, and I'm not sure which is the "preferred" or "best"
> way.
>
> Thanks.
>
>



All Objects of a Class Share Just One Copy of Each Instance Method

Because each instance method is executed in relation to a specific object,
it seems that there exists one particular instance method copy in the
memory
per object. However, this is not the case, because it would consume far
too
much memory. Instead, all objects of the same class share just one copy of
each instance method.

The Rocket class shown next illustrates this point. Two Rocket objects are
created and their references assigned to rocketA and rocketB, respectively
(lines 30 and 31). Even though there is only one copy of the Launch
method,
rocketA.Launch() (line 40) still executes Launch in relation to rocketA,
and
rocketB.Launch() (line 41) executes Launch in relation to rocketB.

01: class Rocket
02: {
03: private double speed;
...
10: public void Launch()
11: {
...
15: speed = 3000.9;
...
20: }
...
25: }

30: Rocket rocketA = new Rocket();
31: Rocket rocketB = new Rocket();

40: rocketA.Launch();
41: rocketB.Launch();

How can C# make this possible? The compiler secretly passes the reference
of
the object for which the method is called along as an argument to the
instance method. If you could look down into the engine room of the
compiler,
it might look like the following lines:

Rocket.Launch (rocketA);
Rocket.Launch (rocketB);

The compiler then (also secretly) attaches the object reference to any
code
inside the method that is specific to the object. For example, during the
Rocket.Launch(rocketA) call, the following line

speed = 3000.9

becomes equivalent to

rocketA.speed = 3000.9

Dec 15 '05 #9

Franky schrieb:
static methods are made for use in things like int.Parse(string s)
(stuctures and very simple datatypes) but not for use in business layers!!!

it may now be easy to use them but in time you will pay for that when
your system seems to be very hard to maintain.

read the following two documents!
http://msdn.microsoft.com/practices/.../html/daag.asp
and
http://msdn.microsoft.com/practices/...tml/boagag.asp

these will give you excellent information on how to build business
layers and data layers

greetz Dries

dn wrote:
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.


Hey Dries,

I do not want to be unkind but did you read the documents to wich you
refer ?

The only paragraph I found where they say avoid using static methods is
in conjunction to COM Interop. Actually the give many examples where
they DO USE static methods.

As I mentioned: Static methods are just a feature of a programming
language. Which you can use within you biz layers or anywhere else in
your code. But in some cases an implementation of a pattern can be done
very smart by using them.

Cheers,

Marcus

Dec 15 '05 #10
I meant all that Jesika wrote, but my reply was more terse... =)

- Michael S

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Good argument Michael.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Michael S" <no@mail.com> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Static methods are useful when you dont' need access to any member in
the class in which the methods are created. The reason for this is
simply saving memory. An instance method is a method which is included
in an instance of a class. When the class is instantiated, a copy of the
class is placed on the stack. This means that, for every copy of the
class, a copy of the method is created. A static method remains in the
heap; there is only one instance of it. So, if the method does not need
to access any instance members of the class, it can be a static method,
and save memory. It *can* access other static members of the class, or
any other static members of any class that is accessible to it.

--
HTH,

Kevin Spencer


Boy, do you have some learning to do.. You are wrong on all accounts.

- Michael S


Dec 15 '05 #11
theiwaz wrote:
Franky schrieb:

static methods are made for use in things like int.Parse(string s)
(stuctures and very simple datatypes) but not for use in business layers!!!

it may now be easy to use them but in time you will pay for that when
your system seems to be very hard to maintain.

read the following two documents!
http://msdn.microsoft.com/practices/.../html/daag.asp
and
http://msdn.microsoft.com/practices/...tml/boagag.asp

these will give you excellent information on how to build business
layers and data layers

greetz Dries

dn wrote:
I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.

Hey Dries,

I do not want to be unkind but did you read the documents to wich you
refer ?

The only paragraph I found where they say avoid using static methods is
in conjunction to COM Interop. Actually the give many examples where
they DO USE static methods.

As I mentioned: Static methods are just a feature of a programming
language. Which you can use within you biz layers or anywhere else in
your code. But in some cases an implementation of a pattern can be done
very smart by using them.

Cheers,

Marcus

Marcus, I fully agree with you that static methods can be vert useful,
but I strongly doubt if it is a good solution to use them in a multitier
application.

The example mentioned:

public class Customer
{
public Customer()
{
}
public static Customer GetCustomer(int id)
{
}
}

Where will you put your code to access your database? I hope not in the
static method.

What I do, and I think that's what is described in those documents, is
creating two assemblies: one assembly contains the class Customer with
only properties (and a few methods).

Functionality like GetCustomer(int id) is put in the second assembly.
This second assembly contains all code to access the database and return
Business Objects from the first assembly.

You can compare this with the DataSet and the SqlDataAdapter e.g.: there
is no static method in the DataSet class the get a DataSet filled with
data. You should first create a DataSet and then use a (Sql)DataAdapter
to fill it with data. And this is a real multitier app!!

You will never have to change you DataSet when you want to use another
DataAdapter (Sql, OleDb, Oracle...).

That is why I think static methods are nog the best practice for
multitier apps.

grtz,
Dec 15 '05 #12
More terse, and not helpful.

I do not wish to disseminate false information. If I am wrong about
something, I want to know what is correct. Having someone tell me I'm wrong
without explanation is not useful to anyone reading the thread. Anyone can
say that something is wrong, and they may be wrong in saying so. This has
happened to me before, many times. The only proof of the veracity of such a
statement is evidence. The evidence given is useful to everyone reading the
thread. In fact, any statement made in a newsgroup without evidence is not
necessarily useful, as there are many people who make incorrect statements,
either unwittingly, or willfully.

We are here, after all, to help each other out, right?

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Michael S" <no@mail.com> wrote in message
news:uj*************@TK2MSFTNGP10.phx.gbl...
I meant all that Jesika wrote, but my reply was more terse... =)

- Michael S

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Good argument Michael.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Michael S" <no@mail.com> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
Static methods are useful when you dont' need access to any member in
the class in which the methods are created. The reason for this is
simply saving memory. An instance method is a method which is included
in an instance of a class. When the class is instantiated, a copy of
the class is placed on the stack. This means that, for every copy of
the class, a copy of the method is created. A static method remains in
the heap; there is only one instance of it. So, if the method does not
need to access any instance members of the class, it can be a static
method, and save memory. It *can* access other static members of the
class, or any other static members of any class that is accessible to
it.

--
HTH,

Kevin Spencer

Boy, do you have some learning to do.. You are wrong on all accounts.

- Michael S



Dec 15 '05 #13

"Franky" <dr***@bestopia.be> wrote in message
news:11***************@seven.kulnet.kuleuven.ac.be ...

The example mentioned:

public class Customer
{
public Customer()
{
}
public static Customer GetCustomer(int id)
{
}
}

Where will you put your code to access your database? I hope not in the
static method.


Why not? Depends on requirements.

I don't question your arhictecture of using two assemblies. By using two
layers you can scale over two tiers if the need should arise.

In the current project I'm working on now, this is not an issue. We simply
won't need to scale. Why should the customer pay for and extra layer we
don't need?

Both designs may be great, depending on the requirements.

- Michael S
Dec 15 '05 #14
You are right, and I was an arrogant bastard.

Now - I stand corrected.

Happy Coding
- Michael S

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:em**************@TK2MSFTNGP10.phx.gbl...
More terse, and not helpful.

I do not wish to disseminate false information. If I am wrong about
something, I want to know what is correct. Having someone tell me I'm
wrong without explanation is not useful to anyone reading the thread.
Anyone can say that something is wrong, and they may be wrong in saying
so. This has happened to me before, many times. The only proof of the
veracity of such a statement is evidence. The evidence given is useful to
everyone reading the thread. In fact, any statement made in a newsgroup
without evidence is not necessarily useful, as there are many people who
make incorrect statements, either unwittingly, or willfully.

We are here, after all, to help each other out, right?

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Michael S" <no@mail.com> wrote in message
news:uj*************@TK2MSFTNGP10.phx.gbl...
I meant all that Jesika wrote, but my reply was more terse... =)

- Michael S

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Good argument Michael.

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Michael S" <no@mail.com> wrote in message
news:Ot**************@TK2MSFTNGP15.phx.gbl...
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
> Static methods are useful when you dont' need access to any member in
> the class in which the methods are created. The reason for this is
> simply saving memory. An instance method is a method which is included
> in an instance of a class. When the class is instantiated, a copy of
> the class is placed on the stack. This means that, for every copy of
> the class, a copy of the method is created. A static method remains in
> the heap; there is only one instance of it. So, if the method does not
> need to access any instance members of the class, it can be a static
> method, and save memory. It *can* access other static members of the
> class, or any other static members of any class that is accessible to
> it.
>
> --
> HTH,
>
> Kevin Spencer

Boy, do you have some learning to do.. You are wrong on all accounts.

- Michael S



Dec 15 '05 #15
Franky,

two options:

Either the Customer object in your example uses the data access layer
to
create cutomer objects. In this case the customer factory resides in
the biz layer.

Or you use leightweight objects which does not ahve any (load, save,
etc) methods, and are created by related factories of the data access
layer.

Both ways are VERY common and often used. In the .NET world AND the
JAVA world.

Cheers,
Marcus

Franky schrieb:
theiwaz wrote:
Franky schrieb:

static methods are made for use in things like int.Parse(string s)
(stuctures and very simple datatypes) but not for use in business layers!!!

it may now be easy to use them but in time you will pay for that when
your system seems to be very hard to maintain.

read the following two documents!
http://msdn.microsoft.com/practices/.../html/daag.asp
and
http://msdn.microsoft.com/practices/...tml/boagag.asp

these will give you excellent information on how to build business
layers and data layers

greetz Dries

dn wrote:

I'm starting an n-tier application with an ASP.NET 2.0 presentation layer, a
business layer, a data access layer, and a SQL Server 2005 database, and I
have a question.

In the business and data access layers, should I use static methods? Or,
should I code the classes so that they have to be instantiated? I've seen
examples of both, and I'm not sure which is the "preferred" or "best" way.

Thanks.

Hey Dries,

I do not want to be unkind but did you read the documents to wich you
refer ?

The only paragraph I found where they say avoid using static methods is
in conjunction to COM Interop. Actually the give many examples where
they DO USE static methods.

As I mentioned: Static methods are just a feature of a programming
language. Which you can use within you biz layers or anywhere else in
your code. But in some cases an implementation of a pattern can be done
very smart by using them.

Cheers,

Marcus

Marcus, I fully agree with you that static methods can be vert useful,
but I strongly doubt if it is a good solution to use them in a multitier
application.

The example mentioned:

public class Customer
{
public Customer()
{
}
public static Customer GetCustomer(int id)
{
}
}

Where will you put your code to access your database? I hope not in the
static method.

What I do, and I think that's what is described in those documents, is
creating two assemblies: one assembly contains the class Customer with
only properties (and a few methods).

Functionality like GetCustomer(int id) is put in the second assembly.
This second assembly contains all code to access the database and return
Business Objects from the first assembly.

You can compare this with the DataSet and the SqlDataAdapter e.g.: there
is no static method in the DataSet class the get a DataSet filled with
data. You should first create a DataSet and then use a (Sql)DataAdapter
to fill it with data. And this is a real multitier app!!

You will never have to change you DataSet when you want to use another
DataAdapter (Sql, OleDb, Oracle...).

That is why I think static methods are nog the best practice for
multitier apps.

grtz,


Dec 21 '05 #16

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

Similar topics

4
by: AckbarJedi | last post by:
Given this very basic program: public class Blah { public static void main (String args) { doStuff(); //Calls the method doStuff }//Closes main
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...
2
by: Simon Harvey | last post by:
Hi everyone, I'm still abit confused about static methods accessing locally declared variables. For example public static bool executeNonQuery(){ SqlCommand cmd; SqlConnection con;
3
by: news.microsoft.com | last post by:
Does anyone know if there is a performance hit in using static methods for the majority of our function calls (we have no requirement for maintaining object state between calls)
2
by: S | last post by:
Hi there, I'm building an application that makes heavy use of centralized static methods (and variables) and would just appreciate hearing someone grade my understanding of the concept. In...
4
by: Joe Fallon | last post by:
In another post Kevin Spencer stated: "one should be careful of using static fields, properties, and methods, by understanding what the implications of such are (e.g. locking static variables when...
2
by: Åženol Akbulak | last post by:
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...
3
by: bradwiseathome | last post by:
I think I learned somewhere that you should never use classes with static methods that use ADO.NET inside an ASP.NET app because there is a danger with thread locks. Is that true for Framework 1.1?...
3
by: =?Utf-8?B?VG9kZA==?= | last post by:
What is the memory footprint of static methods of a windows app running on a server when the server spins up multiple instances of the application? In my envirionment, we have a Citrix server...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.