1. Computing

MVC

By

Definition:

MVC stands for Model-View-Controller. It’s a way of designing an application that separates data access, business logic and the graphical user interface. The goal is to make the application more maintainable. The Model refers to the data and how it is handled, the View presents the data to the user and the Controller interprets the user’s interactions with the View into changes to the Model. In practice the Java implementation of this design focuses on separating the data access and business logic from the GUI.

A simple example is an application that converts meters into kilometers. The Model would be a class that handles the conversion calculation. The View would be a GUI made up of a text field that takes in a value for meters, a label that displays the value in kilometers and a button to press for the conversion. The Controller would be the button listener. Once the button is clicked it gives the Model the value in meters and provides the answer in kilometers to the View. Typically the View and the Controller will be in the same class as it’s simpler to combine them.

There’s a very good explanation of MVC on Oracle's SDN.

Glossary:

# A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

  1. About.com
  2. Computing
  3. Java
  4. Java Glossary
  5. M
  6. Definition for the Java Term: MVC

©2014 About.com. All rights reserved.