Books I read..

  • The Alchemist
  • Many Lives, Many Masters
  • The Monk Who Sold His Ferrari
  • 2 States
  • The 3 Mistakes of My Life

Sunday, August 22, 2010

MVC Architecture in DotNet

MVC Architecture
Its easier to understand when we draw analogies.I draw an analogy of MVC architecture with 3-tier architecture.In 3-tier architecture we have a UI layer,Biz.Logic layer and Data Access Layer.
Here the UI layer corresponds to the "View" layer. The part of Business logic layer that involves fetching data from database and performing manipulations on it from "Business Perspective" form the "Model" layer and
the remaining part of Business logic layer that does the manipulations(if required) on the methods fetched form "Model" layer and also manipulations required in the "View" layer form the "Controller" layer.
The "View" layer is a set of UI controls including the client script thats is .aspx file.
The "Model" layer is a dll that needs to be called in the Controller layer. Since this is a dll all the error handling is done in the form of "Throw exceptions" and these are caught in the "Controller" layer transalting them into user-understandable statements.
Since the Model layer is developed as a dll, it is highly "reusable", can be called from a webpage,service,windows applications etc.
The "Controller" layer is the link between "View" and "Model" layers. This layer is essentially the "server side code" that is .aspx.cs files.

No comments: