ابراهيم حسن طاهر (الثاني - تقنيات لغات البرمجة) PDF
ابراهيم حسن طاهر (الثاني - تقنيات لغات البرمجة) PDF
ابراهيم حسن طاهر (الثاني - تقنيات لغات البرمجة) PDF
University of Baghdad
Department of Computer Science
After taking order from customer, that guy (Manager) give this small purchi to a
man who is sitting outside the kitchen. This man who is sitting outside the kitchen
is acting like a Controller in MVC, means every order is handled by this controller.
This man gives order to appropriate cook for making the order ready.
The cook will see the order & try to make the food ready. If he needs some extra
items to make food like for Dosa he need to make 1 Chatani from coconuts then
cook, visit the fridge & take this coconut & make chatani ready by adding water,
sugar etc. In this scenario the cook is taking data from the database means cook is
acting like Model in MVC.
After some time, the order of that customer is ready. Now the man sit outside the
kitchen, calls the waiter & tell him to serve this order to the customer who ordered
from table number one.
Now waiter adds some items to make better look & feel of food like he add some.
Now the order is ready to eat. This is actual View in MVC. Waiter is responsible
for making decorate view.
The MVC architectural pattern has existed for a long time in software engineering.
All most all the languages use MVC with slight variation, but conceptually it
remains the same.
Let's understand the MVC architecture supported in ASP.NET.
Model: represents the shape of the data. A class in C# is used to describe a model.
Model objects store data retrieved from the database.
View: View in MVC is a user interface. View display model data to the user and
also enables them to modify them. View in ASP.NET MVC is HTML, CSS, and
some special syntax (Razor syntax) that makes it easy to communicate with the
model and the controller.
Controller: The controller handles the user request. Typically, the user uses the
view and raises an HTTP request, which will be handled by the controller. The
controller processes the request and returns the appropriate view as a response.
As per the above figure, when a user enters a URL in the browser, it goes to the
webserver and routed to a controller. A controller executes related view and
models for that request and create the response and sends it back to the browser.
REFRENCES
https://www.tutorialsteacher.com/mvc/asp.net-mvc-tutorials
https://www.google.iq/books/edition/Professional_ASP_NET_MVC_5/FaQLBAA
AQBAJ?hl=en&gbpv=1
Wikipedia.org