Where or where does my business logic go. ASP.NET MVC.

I'm new to ASP.NET MVC development and I have a question regarding Business Logic.  Specifically, where should the Business Logic live in my application.

Just to give you a bit more information about my current MVC application structure, I've decided to go with a Unit of Work Design Pattern and the Repository Design Pattern for my Data Access Layer.  This was chosen to allow flexibility as the data source may be changing and we want to make the application decoupled from it's original data source.

Here's a business logic scenario I have and I'm questioning where it should live.  

I need to gather information from 3 individual tables in my database, perform some calculation on that data (and in some cases merge some data) and return the matching row(s) to my Controller so that can be displayed in my View.  

In my search to discover where to put this logic I was pointed in several different directions.  For example:

- Your business logic should be placed in the Model, and you should be aiming for fat models.
- Most of your logic goes in the MVC controller
- Controller shouldn't have any logic and should be "thin"
- You should create a "Service Layer" and put your Business Logic there.

I'm lost.  Help.
Lynn CurtDeveloperAsked:
Who is Participating?
 
David Johnson, CD, MVPOwnerCommented:
MVC stands for model view controller
Model is for your logic
View is for what the user sees
Controller  accepts input and converts it to commands for the model or view.
https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.