# Design Patterns
## MVC pattern
> **Traversy Media**
> https://www.youtube.com/watch?v=pCvZtjoRq1I
> **GeeksForGeeks**
> https://www.geeksforgeeks.org/mvc-design-pattern/
>
MVC = Model View Controller
The MVC design pattern specifies that an application consists of a data model, presentation information, and control information. The pattern requires that each of these should be separated into different objects.

* The **Model** contains only the pure application data/connects with the application database; it contains no logic describing how to present the data to a user.
* The **View** (UI) presents the model’s data to the user. The view knows how to access the model’s data, but it does not know what this data means or what the user can do to manipulate it. Dynamic data can be passed from Controller to View with Template Engines.
* The **Controller** exists between the view and the model. It listens to events triggered by the view (or another external source) and executes the appropriate reaction to these events. In most cases, the controller gets data from the model and passes the data to the view. It processes requests (GET, POST, PUT, DELETE).

## Observer Pattern
> **Christopher Okhravi** - https://youtu.be/_BpmfnqjgzQ
We have two things - one changes states and the other thing wants to know the states of the first type of object. So the second type have to constantly nag the first one to know if the states have changed. This is ==Polling==
Inspite of this process, ==Pushing== can be used.
The two types of entities can be called - **Observable** and **observers**. In pushing, the observable(subject) can push notifications to all the observers when its states change.
> **medium** - https://medium.com/datadriveninvestor/design-patterns-a-quick-guide-to-observer-pattern-d0622145d6c2
> **refguru** - https://refactoring.guru/design-patterns/observer