Model-view-controller (source code)

= Model-view-controller
{wiki=Model–view–controller}

= MVC
{c}
{synonym}

Separate an application's domain state and rules into a model, its presentation into a view, and interpretation of user actions into a controller. The controller requests model operations; the view renders coherent model state. A playlist model, for example, owns song order independently of whether a menu, button or keyboard action requests a move. The <Observer pattern> often carries model-change notifications to views, but <model-view-controller> defines responsibilities rather than requiring a particular notification mechanism. This supports <separation of concerns> and testing domain logic independently of a graphical interface.