ASP.NET MVC framework basically designed to build the web applications which take the general
legacy approach Model View Controller Pattern. This pattern existed in tech space since decades;
this is not something which is being built by Microsoft from ground Zero. However, Microsoft has
introduced its very own MVC framework called as ASP.NET MVC Framework. Also, it’s equally
important to understand that Microsoft hasn’t written this MVC Framework right from the scratch,
rather it’s been built on the TOP of ASP.NET which means, ASP.NET MVC still has almost all
features of ASP.NET like Master Pages, Session Management, Caching, Different types of
Authentication and many more thing.
Also, one more important thing to understand here that ASP.NET MVC is not the replacement of
ASP.NET Web Forms. Microsoft has provided MVC as an alternative approach to build the web
application. So, going forward, now there will be two different approaches to build the web
application. However, ASP.NET MVC basically follows the same core principle what other
languages follow
The MVC Pattern:-
Model: - Models are basically a collection of classes where in you will be working with data logic as well as business logic. So, basically models are containers which are business domain specific or I would say section which is used to interact with database and also used to manipulate the data to implement the business logic. So, with ASP.NET MVC this is pretty much
easy to use data access layer with Entity Framework, ADO.Net or NHibernate combined with custom code.
View: - Views are nothing but a pure HTML which decides how the UI (User Interface) is going to look like. All I can say is that views are basically templates which decide the look and feel or presentation of your app. This is the section which is going to present the static HTML with extracted data from database at the desired place.
Controller: - Controllers are basically a bunch of classes which handles communication from the user. This is the one which is responsible for taking incoming HTTP Request and transferring the control to the appropriate section of the application. So, this is the special class which wires up the relationship between view and model. So, it responds to the user input, interacts with the model and decides which view to render. Basically, Controller classes maintain
one convention that it has to be suffixed with the name “controller”.
No comments:
Post a Comment