1. Technology
Send to a Friend via Email



Woman using laptop
Johner Images/Getty Images

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.


# 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. Technology
  3. Java
  4. Java Glossary
  5. M
  6. MVC (Model-View-Controller) - Java Term Definition

©2014 About.com. All rights reserved.