First you can split your layers using interfaces, and interfaces can be divided into dll partitions. Thus, each layer is dependent on the interface of the underlying layer.
I'm also not sure why you need to bind DAL with BLL? Is it for calls? Can't you use events instead?
Assuming all 3 levels are running in the process and assuming your PL is the βentry pointβ to your application (Root Composition), IMO is the usual dependency, if you separate the interfaces, with the bootstrap code in the PL, this is
- PL => Links to BLL and DAL (concrete and interfaces) and IoC container
- BLL DAL Links (or just an interface, if applicable)
- DAL no Dependency (although this usually depends on DTO / POCO / Entities)
PL can offload the IoC configuration in the Bootstrapper dll, resulting in:
- PL => Links to the BLL interface and bootloader
- Bootstrapper => All links and IoC container
- BLL => Links DAL Interface
- DAL => No dependency (although usually it depends on DTO / POCO / Entities)
In some containers, you can avoid the need to reference all dlls from the bootloader using a configuration or convention . However, these DLLs obviously still need to be deployed with your application.
source share