I already have a layered data access design which works well. But i dont know if it is the most suitable implementation or not.
i simply want to know that BLL classes or methots should be static or they should be concreate classes which has only one instance?
In the mean time i dont need to serialize BLL classes to use it in such a SOA design. But i dont know what the feature will bring.
Look at the following options:
- BLL classes and methots are static
- BLL classes are not static but its methots are static
- BLL classes are not static nor its methots. Application should create the BLL class everytime inorder to access its methots.
- BLL classes are not static nor its methots. But there is only one instance of each BLL class. And application uses these static instances inorder to use BLL methots.
Which one is the most efficent mostly in performance and desing?
EDIT:
Option1
public static class BllCustomer
{
public static List<ModelCustomer> GetCustomers()
{
}
}
// usage
BllCustomer.GetCustomers();
Option2
public class BllCustomer
{
public static List<ModelCustomer> GetCustomers()
{
}
}
// usage
BllCustomer.GetCustomers();
Option3
public class BllCustomer
{
public List<ModelCustomer> GetCustomers()
{
}
}
// usage
BllCustomer bllCustomer = new BllCustomer();
bllCustomer.GetCustomers();
Option4
public class BllCustomer
{
public List<ModelCustomer> GetCustomer()
{
}
}
// usage
public static BllCustomer s_BllCustomer = new BllCustomer();
// whenever needed
s_BllCustomer.GetCustomer();