Reputation: 1490
I am working on my first ever .NET 4 MVC project migrating from being stuck in .net 2 in webforms for years.
I am trying to understand how to separate my projects.
I currently have a project.data library that contains my entity data model.
I have created my business logic project and unsure whether my view models should be here, and whether CRUD functions directly to the entity such as entitytable.add() etc. should be in this layer or back in the data project. Noting that it appears I need to redefine the connection strings in a web.config in the business logic project.
Am I missing something here in my understanding of the separation or does this all sound correct?
Upvotes: 1
Views: 174
Reputation: 9081
The best way is to separate your projects like this :
DAL : data access layer : project of connection to your data source
Repository : project that contains the mapped entities with methods of crud that you need
BLL layer : Business logic Layer : a project that contains your model and your business handling
Services Layer (Optionnally)
UI : project contains your views ( in an MVC architecture : it contains the views , the controllers and the view-models )
Upvotes: 1