Today I was looking through a sample Asp.Net MVC application and the first thing I noticed is that one of the controllers had 4 repositories injected into the controller (hey, at least they are injected right :) ). The code then went onto to interact with the various repositories in each of the various controller actions. In one case a controller chatted with a single repository 5 times.....:(
My question is this. How is having the controller chat with a repository different than having your code behind do so?
To me this is just NOT good. In my opinion the controller should only interact with either services (if you buy into that design pattern) or other business layer objects. I like the idea that my controller actions are skinny (thanks for that term Chris) and contain very little 'logic'. My fear with MVC is that controller actions will turn into the click events we have today with WebForms.
Am I off base? Thoughts... Comments.... Lets Debate this
Till next time,
10-22-2008 7:03 AM