Programming Index Cards

August 16, 2008

Model View Controller

Filed under: design patterns — Tags: , — apcig @ 1:38 am

Model View Contoller – a … design pattern often used by applications that need the ability to maintain multiple views of the same data.1

Model

  • Encapsulates core application data and functionality Domain Logic/Business Logic.
  • Since the model must be independent, it cannot refer to either the view or controller portions of the application.

View

  • obtains data from the model and presents it to the user.

Controller

  • receives and translates input to requests on the model or the view.

Benefits of MVC

  • Substitutable user interface
    Different views and controllers can be substituted to provide alternate user interfaces for the same model.
  • User interface components
  • Multiple simultaneous views of the same model
  • Syncronized views
  • Easier user interface changes
  • Easier testing

Drawbacks of MVC

  • Increased complexity
  • Close coupling of views and controllers to model
  • Potential for excessive updates
  • Close coupling between view and controller

Summary of article by the Web Application Component Toolkit
Source

Blog at WordPress.com.