In Chapter 3, Styling the User Interface, we talked a bit about the Model View Controller (MVC) architecture. This architecture splits our files out into datafiles (
Stores), interface files (
Views), and files that handle functionality (
Controllers). In this section, we will focus on the controller part of the MVC.
At its most basic level, a controller assigns listeners and actions within the application. Unlike our previous example, where the single component is responsible for handling an event, the controller will handle the events for every component in our application.
This division of labor offers a few different advantages when creating an application; they are as follows: