Having implemented the View and the Model, we now need to ensure that they communicate with each other and that their elements are properly updated. The Controller is a simple object, at least when compared to the Model. It only has two basic responsibilities: to be the mediator between the Model and the View, and to update the state of the Model itself according to the rules that govern our system. The Controller will consist of the standard
initiated (in our design) members as well as the necessary
populationUpdate agents. Note that the Controller needs access to both the Model and the View, therefore, when we initialize it, we should make sure we assign the latter to variables accessible to all elements ...