.net中类的设计,使用静态方法好吗?
如:使用静态方法类
public class Test{
public Test(){}
public static int Add()
{
//....
return 1;
}
}
调用时,只一条语句,非常简单
Test.Add();
非静态的方法
public class Test2 {
public Test2(){}
public int Add()
{
//....
return 1;
}
}
调用时
Test2 cls = new Test2();
cls.Add();
在一些系统中使用了好多静态方法,大家能否说明一下优缺点呢?