Thoughts on Software Development, .Net, OOP, Design Patterns and all things cool
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,
About Derik Whittaker
Derik is a .Net Developer/Architect specializing in WinForms working out the northern suburbs of Chicago. He is also believer and advocate for Agile development including SCRUM, TDD, CI, etc.
When Derik is not writing code he can be found spending time with his wife and young son, climbing on his bouldering wall, watching sports (mostly baseball), and generally vegging out.