ITWissen.info - Tech know how online

model view controller (MVC)

Model View Controller (MVC) is a design pattern for realizing GUI components using object-oriented programming. According to this pattern, each graphical component has three components, each of which is represented by its own class:

  • The model contains the data to be displayed (list entries, text, the label of a button, etc.). The data can be queried externally using methods provided for this purpose and change requests can be made known, although these can also be rejected by the model.
  • The view represents the data in the interface, it is the visible part of the GUI component in the MVC pattern and is responsible for the appearance (size, color, position, etc.). The data to be displayed is requested by the view from the model.
  • The controller receives user actions(keystrokes, mouse clicks, etc.) and processes them in the form of messages to the view and model.
The MVC design pattern appears at first quite complicated, particularly since some GUI libraries permit quite also a less cleanly separated approach and settle the tasks "data keeping" and "control" within the graphic element. However, the clean separation leads to easier maintainability of finished programs and enables interesting applications with little effort, such as different views of the same dataset within an application program.

Informations:
Englisch: model view controller - MVC
Updated at: 27.03.2008
#Words: 209
Links: design pattern, graphical user interface (GUI), object (O), class, data
Translations: DE
Sharing:    

All rights reserved DATACOM Buchverlag GmbH © 2024