The Model-View-Controller (MVC) paradigm is what we're using here within Express. While not really necessary in Express, I find the logical separation of concerns is useful and easier to work with than monolithic types of undifferentiated files. Before we go too far, I will mention that MVC could be considered an outdated pattern, as it does create some additional dependencies between layers. With that being said, the ideas behind an architectural paradigm that separates logic into discrete actors are sound in MVC. You may hear MV* used instead, which basically should be read as "model, view, and whatever that binds them together." MV* is more popularly used these days in certain frameworks.
The MVC construction separates the logic of the program into three parts:
- Models deal with data interaction.
- Views handle the presentation layer.
- Controllers handle data manipulation and serve as the glue between the models and the views.
Here's...