I was wondering if someone could help me.
I Have a n-tier application and each layer is a class lib. DAL -> BLL -> PL Data Access Layer -> Business Logic Layer -> Presentation Layer
In my PL i Need to reference my wrapper class "Shippers" from the DAL however i want to remove the dependency to my DAL and make it go through my BLL. This forces me to have a duplicate class of my shippers in my BLL.
However How would i link two of the same classes in 2 different Libs? I also have no clue of what the term of duplicating the same classes is known as?
Here is my Shippers Class
public class Shippers
{
public int ShipperID { get; set; }
public string CompanyName { get; set; }
public string Phone { get; set; }
}
In that case, use
Compositiontechnique and in yourBLLproject add the dll reference of the library which containsShippersclass. Bll class have the Shipper as member field and expose a public property/method which returns a instance ofShipperand access the same from yourPL DAL. Like below:BLL ProjectPL DAL Project