Understanding MVC Design
-
Upload
instedd-ilab-southeast-asia -
Category
Technology
-
view
160 -
download
2
Transcript of Understanding MVC Design
+
Thyda ENG, Software Developer
Understanding The MVC Design
+What is MVC ?
■ is stand for Model View Controller.
■ is the software architecture commonly used for creating web applications or software.
1
www.ilabsea.org | @ilabsea
+Components
2
www.ilabsea.org | @ilabsea
+Controller
■ It is a link between a user and the system, middle man.
■ Manages the user request when the user click on GUI of the system
3
Controller
www.ilabsea.org | @ilabsea
+Controller
View
Controller
Model
receives data from the view, via user inputuses the right model
determine which action needs to be taken
load the view
4
www.ilabsea.org | @ilabsea
+Model
■ represents the knowledge.
■ is the data and the rules applying to that data.
■ a model could be an object.
5
www.ilabsea.org | @ilabsea
+Model
View
Controller
Model
receives instruction via the controller and work with data
return data to the controller
6
www.ilabsea.org | @ilabsea
+View
■ present the data receive from controller.
■ provides the different ways to present the data.
■ is the template that contains the markup of page.
7
view
+View
View
Controller
Model
works with the controller directly to retrieve the data
display the content retrieved by the controller
is the GUI that enable the user to interact with the system
8
+MVC Diagram
View
Controller
Model
3. return the result to controller
4. controller get the information requested and send back to the user with appropriate view
1. user input some action, perhaps from a form or by clicking a button.
2. determines what to do with the data the user input from the view, and send it to the right model.
9
www.ilabsea.org | @ilabsea
+Advantages
■ turn an application into a maintainable, modular and rapidly developed package.
■ clear separation of presentation and application logic.
■ reduces the complexity when designing large application.
10
www.ilabsea.org | @ilabsea
+Example
View
Controller
Model
11
are pages for view books, register, buy, add items
contains actions such as: view books, register, buy, add items
handle data and logic related to the items in the shop
Develop the online book store
www.ilabsea.org | @ilabsea