ASP. NET MVC - Model
Asp.net mvc tutorial
ASP.NET MVC - Pattern
The Model-View-Controller (MVC) design pattern has actually been around for a few decades and has been used in many different technologies. Everything from Smalltalk to C ++ to Java, and now C Sharp and .NET use this design pattern to create a user interface.
Here are some salient features of the MVC model -
Originally it was called Thing-Model- View-Editor in 1979, then it was then simplified into Model-View-Controller.
This is a powerful and elegant way to separate concerns within an application (for example, separate data access logic from data access logic display) and applies extremely well to web applications.
Its explicit separation of concerns adds a small amount of additional complexity to an application design, but the benefitsExtraordinary outweighs the extra effort.
The MVC architectural model separates the user interface (UI) of an application into three main parts.
The model - A set of classes that describes the data you are working with as well as the business logic.
View - Defines how the user interface of the application will be displayed. This is pure HTML, which decides what the application will look like user interface.
The controller - A set of classes that manages communication from the user, the overall flow of the application and application-specific logic.
Idea behind MVC
The idea is that you will have a component called the view, which is solely responsible for rendering this UI, whether it's HTML or actually UI widgets on a desktop application.
The view speaks to a model, and vsThe model contains all the data that the view should display. Views g In general, they don't make much sense at all.
In a web application, the view might not have any associated code at all. It can just contain HTML and then expressions that indicate where to take data elements from the model and insert them in the right places in the HTML model you created in the view.
The controller who organizes, that's all. When an HTTP request arrives for an MVC application, that request is routed to a controller, and then it is up to the controller to talk to the database, filesystem, or model.