Skip to main content

MVC, A Design Pattern

MVC stands for Model - View - Controller, it's a design patter that is very famous and popular among developers these days. It's used to build scalable apps that separate the content into three different layers.

The model contains the persistent data of our app like variables and functions. The View is responsible for rendering the components on our html page. The controller does the even-handling through listeners to listen to when the model data changes.

When the model data changes then the controller will sense that change and the view will re-render the page with the updated data.

This is mostly everything that I know about MVC up until now.

Comments

Popular posts from this blog

Stack vs. Queue

Stack is like a pile of  books placed on top of each other. We can add new books to the top and can remove them from only the top because stacks are LIFO which means last-in, first-out. Queues on the other hand are the opposite, which is FIFO meaning first-in, first-out. So adding an element to the queue will be the same but removing will happen to the first element not the last one. An example of a queue would be the wait line in front of any kind of service we see around us like the bus station or the shops,....etc.

Middlewares

Middlewares in Javascript are functions that come in the middle of the request-response cycle. They have access to both the request and the response object as well as the next middleware function to be executed; usually called next(). Popular examples on middleware include: body-parser, cors, session, cookie-seesion and cookie-parser.