<groan>
If you try really hard you can write a whole application using only static
methods and ensuring the maximum of spaghetti code too.
Static functions should be used only where the architecture demands a clean
and stateless system of operation. The Math class in .NET is a primary
example of good use of static methods.
Using static as a replacement for Global is a recipie for disaster and a
sign of one of two things. #1 having learned programming with classic VB and
#2 having no clue about object oriented architecture.
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
"Jay Balapa" <jb*****@atginc.com> wrote in message
news:O0**************@tk2msftngp13.phx.gbl...
Static functions are used in situations where you want to share some
Business Logic code over and over in your UI. Think of them as global
functions. You dont have to create an instance to access the code thus
reducing lot of overhead.
puclic class MyBusinessLogic
{
public static DataTable GetUniqueCustomerList()
{
}
}
In your UI Code you can call-
DataTable myTable=MyBusinessLogic.GetUniqueCustomerList();
--
Jay Balapa
Director Of Software Engineering
www.atginc.com
"Kylin" <ga*******@gmail.com> wrote in message
news:uf**************@TK2MSFTNGP10.phx.gbl... which situation should use the static function ?
--
FireCrow Studio
Kylin Garden
EMail:w0**@sohu.com
ICQ:156134382