<p>Derik Whitaker posted an <a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/10/22/how-is-interacting-with-your-data-repository-in-your-controller-different-or-better-than-doing-it-in-your-code-behind.aspx" rel="noreferrer">article</a> a couple of days ago that hit a point that I've been curious about for some time: <strong>should business logic exist in controllers?</strong></p>

<p>So far all the ASP.NET MVC demos I've seen put repository access and business logic in the controller.  Some even throw validation in there as well.  This results in fairly large, bloated controllers.  Is this really the way to use the MVC framework?  It seems that this is just going to end up with a lot of duplicated code and logic spread out across different controllers.</p>

Business logic should really be in the model.  You should be aiming for fat models, skinny controllers.
For example, instead of having:
```
```
public interface IOrderService{
    int CalculateTotal(Order order);
}
```
```
I would rather have:
```
```
public class Order{
    int CalculateTotal(ITaxService service){...}        
}
```
```
This assumes that tax is calculate by an external service, and requires your model to know about interfaces to your external services.
This would make your controller look something like:
```
```
public class OrdersController{
    public OrdersController(ITaxService taxService, IOrdersRepository ordersRepository){...}

    public void Show(int id){
        ViewData["OrderTotal"] = ordersRepository.LoadOrder(id).CalculateTotal(taxService);
    }
}
```
```
Or something like that.