What is a model?

The model in MVC represents the data. This includes the storage of the data, but also the various ways data can be queried or manipulated. Ideally, the model is not concerned or affected by how data will be presented or what UI controls will be granted, but rather presents a high-level interface that only minimally concerns other components with its inner workings. In theory, if you decided to completely change the UI of the program (say, from a Tkinter application to a web application), the model should be totally unaffected.

Some examples of functionality or information you find in the model include the following:

  • Preparation and writing of program data to a persistent medium (data file, database, and so on)
  • Retrieval ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.