-- Practice Midterm Problems Thread
Caitlyn Chau, Hanh Nguyen
Question 9: Briefly explain and give an example use of the following design patterns: (a) mediating Model View Controller, (b) Post Redirect Get.**
Mediating Model View Controller is a variant of MVC. Instead of the controller interacting with the model, and the model updating the views in traditional MVC, the controller invokes BOTH model and view functions. The controller becomes a communication hub accepting any updates from both Model objects and UI events from the View. An example use case is like Assignment 2, where the user clicks on Cause links, which sends form data in the URL. The controller would process that form data and calls the appropriate view to display while also getting any appropriate databases.
Post Redirect Get is another design pattern that lets the page shown after a form submission be reloaded, shared, or bookmarked without resubmitting the form again. An example use case would be in e-commerce websites like Amazon. If a user refreshes the page after placing their order, they would not be charged multiple times.
Caitlyn Chau, Hanh Nguyen
Question 9: Briefly explain and give an example use of the following design patterns: (a) mediating Model View Controller, (b) Post Redirect Get.**
Mediating Model View Controller is a variant of MVC. Instead of the controller interacting with the model, and the model updating the views in traditional MVC, the controller invokes BOTH model and view functions. The controller becomes a communication hub accepting any updates from both Model objects and UI events from the View. An example use case is like Assignment 2, where the user clicks on Cause links, which sends form data in the URL. The controller would process that form data and calls the appropriate view to display while also getting any appropriate databases.
Post Redirect Get is another design pattern that lets the page shown after a form submission be reloaded, shared, or bookmarked without resubmitting the form again. An example use case would be in e-commerce websites like Amazon. If a user refreshes the page after placing their order, they would not be charged multiple times.