2

I am working on a asp.net mvc project. Also I want to use n-layer solution structure. So, I am using the following structure for my solution. It shows specially the part of the solution I have doubts with. I am planing to create interfaces for each entity I need in order to not repeating code and not have problems when passing data (lists or objects) from dal to presentation. What do you think? Is that a good approach?

[Project Structure Representation [1]

Cœur
  • 37,241
  • 25
  • 195
  • 267
Flezcano
  • 1,647
  • 5
  • 22
  • 39

2 Answers2

0

I think you're missing the point of what MVC is. It effectively handles your layers. Using a BAL and DAL is N tier application. If you were using a real MVC project these layers are meaningless. It's better to work with Generic repository pattern. LINK

ANJYR
  • 2,583
  • 6
  • 39
  • 60
0

You should create a Domain layer which will be the core of your project, in there you put your entities, your interfaces for entities, repositories and services, and this layer do not references any other layer. It makes your architecture more flexible, for example, if you work with NHibernate, but needs to change to EF, you just create a Class Library, and implements the repository interfaces that is in Domain layer, and the other layers not need any change.

Pedro Benevides
  • 1,970
  • 18
  • 19