Model-View-Controller-Store Design Pattern
In this exercise, we expanded on the PossessionStore to allow it to save and load Possession instances from the filesystem. The controller object asks the PossessionStore for the model objects it needs, but it doesn’t have to worry about where those objects actually came from. As far as the controller is concerned, if it wants an object, it will get one; the PossessionStore is responsible for making sure that happens.
The standard Model-View-Controller design pattern calls for the controller to be bear the burden of saving and loading model objects. However, in practice, this can become overwhelming – the controller is simply “too busy” handling the interactions between model and view objects to deal ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access