Suppose I am developing an application for a product distributor in C#.
The distributor does the following 3 types of transactions:
(1) Indent
(2) Sell
(3) Stock
I am designing 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 should I design my DA layer?
Should I build separate DA classes like
(1) IndentDA
(2) SellDA
(3) StockDA
or a single class TransactionDA
and perform CRUD operations by checking their types by using as/is
operators?
Or what else can I do? Any suggestions?