Suppose I am developing an application for a product distributor in C #.
A distributor performs the following 3 types of transactions:
(1) Indent
(2) Sell
(3) Stock
I design my classes as follows:
public abstract class Transaction
{
}
public class Indent : Transaction
{
}
public class Sell : Transaction
{
}
public class Stock : Transaction
{
}
Now, if I want to save these three types of information in three separate tables, then how do I create my DA level?
Should I create separate DA classes such as
(1) IndentDA
(2) SellDA
(3) StockDA
or one class TransactionDAand perform CRUD operations by checking their types with operators as/is?
Or what else can I do? Any suggestions?
source
share