Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In the object-oriented programming community, a very common design pattern is Model-View-Controller. This design pattern says that each class you write should fall into exactly one of the following groups.
1. Model classes describe your data. For example, if you write banking systems, you would probably create a model class called SavingsAccount that would have a list of transactions and a current balance. The best model classes include nothing about the user interface and can be used in several applications.
2. View classes are part of the GUI. For example, NSSlider is a view class. The best views are general-purpose classes and can be used in several applications.
3. Controller classes are usually application-specific and are responsible for controlling the flow of the application. The user needs to see the data, so a controller object reads the model from a file or a database and then displays the model by using view classes. When the user makes changes, the view objects inform the controller, which subsequently updates the model objects. The controller also saves the data to the filesystem or database.