I am trying to write a small application with very strict boundaries between BLL and DAL, and now I am wondering what is the best way to transfer data (domain transfer objects) between layers.
I have implemented some classes at the domain level (class library), which are accessed by both BLL and DAL. These classes basically just contain properties / data elements and currently reflect DAL data. Example:
class CustomerData
{
}
Then I implemented some classes in BLL as:
class Customer : CustomerData
{
}
In my DAL, I get client entries from the database through Linq-to-Sql. Then I map the linq object to the Domain object:
CustomerData.field = LinqObject.field
My thinking is that I am now an instance of CustomerData from my DAL in the BLL on request (and that I have to pass the instance of Customer to my user interface).
BLL , , CustomerData, .
:
- BLL Customer AGAIN ?
c = ;
c.field = CustomerData.field; - CustomerData ?
- ?
{
CustomerData;
} - ( ..) ?
- ?
- ?
!