Was asked today why I used code like this for my bll classes in an asp.net app:
public class StudentBll
{
public static DataTable GetStudents()
{
return DBHelper.ExecuteSp("GetStudents");
}
public static DataTable GetStudentById(int studentId)
{
return DBHelper.ExecuteSp("GetStudentById", studentId);
}
}
instead of
public class StudentBll
{
public DataTable GetStudents()
{
return DBHelper.ExecuteSp("GetStudents");
}
public DataTable GetStudentById(int studentId)
{
return DBHelper.ExecuteSp("GetStudentById", studentId);
}
}
Only thing I could think of was that
A) Performance A slight increase (not sure of the specifics)
B) Readability
StudentBll.GetStudents();
rather than
StudentBll studentBll = new StudentBll();
studentBll.GetStudents();
I wasn't too confident in those answers, however. Anyone care to enlighten me?