HTML and CSS Reference
MVC explained by a Silly analogy
to understand mVC in its simplest form, think about ordering a pizza. you call the pizza parlor and speak to the
cashier, who takes your order. When you complete your order, the cashier tells the cook what was ordered, and the
cook sets about making the pizza. after the pizza is out of the oven, the cook gives it to the cashier, who packages
the pizza for delivery and hands it to a delivery driver, who subsequently arrives at your home with the pizza.
in this example, the cashier is the controller. you interact with her via the phone—the URI —and give her your
order— instructions —which she interprets.
the cook is the model . the cashier asks him for the pizza you requested— data —which he gives to the
cashier. the cook takes the request, creates the pizza, cooks it in the oven, and hands it to the cashier.
the cashier then prepares the pizza for delivery— logic —and gives it to the driver, who is the resulting view
from the interaction. after the cashier gives her instructions, the driver delivers the pizza to you— display —for
your enjoyment. the driver never touches the pizza in any way except to bring it to you; it would be pretty weird if
your pizza delivery driver had his hands on the raw ingredients of your food.
■ mVC dates back to 1979 2 and has been interpreted, reinterpreted, and re-reinterpreted by programmers
across dozens of languages in the 30+ years since its conception. there is no absolute right way to implement mVC.
it's a philosophical principle that guides development, and, as with all philosophies, it will vary in practice between
camps. Don't stress about it.
Determining the Database Structure
In order to store information about the rooms and questions, you'll need a database. In this section, you'll come up
with a list of data that needs to be stored and determine the structure for said data.
What Data Needs to Be Stored?
To start, let's make a list of everything that needs to be stored for the app to function properly. This includes both the
room and question information:
The room's name
A unique identifier for the room
Whether or not the room is active
The presenter's name
A unique identifier for the presenter
The presenter's email