Our business requirements required to create a layered and modular architecture. So I designed an architecture to make it as decoupled and as modular as possible. I will list my layers below
- ASP .NET MVC Application (UI)
- Business Logic Layer (BLL)
- Data Access Layer (DAL)
I have further used IOC where each BLL module defines its Data Access requirements in terms of interfaces. So DAL has now to implement these interfaces.
It is important to note that
- Both UI and DAL are dependent on the BLL
- BLL is not dependent on any other solution. Using Interfaces I have done IOC so now DAL is dependent on BLL and not the other way round.
- BLL is not just one project but a set of class library projects - one class library each for each business module.
- DAL is a single class library project "shared" by all the BLL projects (since Database is same and it did not make sense dividing DAL into separate projects).
I will not go into details here but let us say there was a decision to use EDMX. However now I do not see how EDMX will fit into this mix. I believe I am not the only person ever to divide the BLL into different class libraries but have a single DAL project. But can EDMX or for that matter any ORM support such "distributed" architecture ?