I am new to MVC and started working on a small application.
I have a basic idea about what to do and want to use MVC and EntityFramework.
I want to create a separate Business Layer.
I want to put all the Model declaration in business layer and want to put the entire business logic in that.
From MVC Web Application Controller will make request to that Business library.
Please guide me. Is it possible or I am in wrong direction?
3
Yes, keep your business logic in its own assembly. This will help to keep your layers separate. Don’t let purely UI concerns creep in there, and don’t let your data layer leak through in anyway. The idea is that when MVC / Razor is no longer the current way to build your web app, you can throw away your UI layer and keep your business rules, which is where your real value is. The same goes for your data layer; at some point EF will not be the way to go, and you want to be able to throw it away without it having any impact on your UI layer (since the business layer talks to the data layer somehow, it will have some impact there).
0