software master at the intersection of technology, science and art

home

download

controller


The controller serves as the traffic cop. A requests maps to a controller method. In the MVC architecture the action usually returns a View or a Partial View. mHowever, it may also return data as in an ajaz . A partial View can be called asynchronoulsy thorugh an ActionLink, javascript Ajax calls and other methodologies to "fill in" dynamically a portion of a View. This produces a early cariant of a Single Page Application (SPA) as portions of the view are loaaded from separate calls.


There is the concept of a "thin" and "thick" controller. I believe in the thin controller. All data manipulation is done in the model and then returned to the controller. The controller should not see any datasource. This loosely couples the datasource.