我在一个习俗基类中注意到,我们用于我们许多网页,我们有一些固定的方法。 由于这一类别正被用作网页的基级,因此它会使方法静态? 我不认为是没有,而是希望进行核查。
Also in custom base class we have properties that call other static methods in a manager class of ours in another class library and returns either a DataTable or HashTable. I can see where as a convenience factor for devs to code against but other than that is their any reason for making the methods static in there as well?
因此,现行法典认为:
public class CustomBaseClass
protected Hashtable displayText
{
get{
if(_displayText == null)
displayText = MyManager.GetCustomersList(sCustID);
since GetCustomersList is static every method inside this method has to be static as well. All the way down to our data access layer. Just seems odd to me coding it this way but was curious as to what you all thought.
我们的老发展者们把我们的申请编成法典,他们全都使用。 他们是否对使用静态方法,特别是在 as网口使用静态方法表示任何负面或 watch?
如果我制造一个更有意义的单一吨吨位,那么我就不必把所有方法打上我们的DAL静态? lo