I'm not using hibernate and that's not a valid alternative at all. I developed a framework based on ADO.NET. This framework has default operators for each database entity.
For example, data access layers has default operators as the following:
Insert
Update
Delete
Get
GetAll
To access this methods, we work as tha sample code below:
DataAccess.Order daoOrder;
Entity.Order entityOrder;
DataAccess.Order daoOrder;
entityOrder = new Entity.Order();
entityOrder.ID = 1090;
daoOrder = new DataAccess.Order();
daoOrder.Insert(entityOrder);
I was thinking about use static methods, so the code would be simple as:
Entity.Order entityOrder;
entityOrder = new Entity.Order();
entityOrder.ID = 1090;
DataAccess.Order.Insert(entityOrder);
Suppose that the system has 30 tables and 30 entities. We need 30 DataAccess objects running as statics objects. This static structure would save us some processor cycles and save some memory as its costs less for garbage collector.
Should I use static methods for Business and DataAccess common operators in these way? Can you talk about advantages and drawbacks about this approach? (I mean, memory, performance...)