I am starting project which will use 3-tier architecture with REST API.
I would like to split each layer into separate module, so I definitely need at least 3 modules:
- REST
- BLL
- DAL
What is the best approach to make dependencies between them:
1)
- REST depends on BLL
- BLL depends on DAL
- DAL depends on nothing
2)
- REST depends on nothing
- BLL depends on REST
- DAL depends on BLL
3)
- REST depends on REST-BLL-Interfaces
- REST-BLL-Interfaces depends on nothing
- BLL depends on REST-BLL-Interfaces and DAL-BLL-Interfaces
- DAL-BLL-Interfaces depenends on nothing
- DAL depends on DAL-BLL-Interfaces
Third approach seems to be the most compatible with Dependency Inversion Principle but requires more modules. How would You name those two additional modules?