design - Program Design MVC Architecture There are many...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Program Design MVC Architecture There are many different design patterns for programs – ways to organize your code to make it easy to read and easy to change. You will learn more about these design patterns in a later class, CIS 501. Once such design pattern is the Model-View-Controller architecture , which has you divide your code into three parts: - Model : stores data, performs calculations - View : handles user input and output - Controller : controls the flow of the program In this organization, the Model and View components never communicate. Instead, the Controller gets input from the View and gives it to the Model. Then it gets results from the Model and gives them to the View to display. In larger programs, the Model, View, and Controller component will likely be several classes each. However, in our first examples, we will use one class for each component. For an example, suppose we want to write a program that determines whether a number is divisible by nine. Numbers are divisible by nine if the sum of their digits are divisible by nine. We will write this program using MVC architecture.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/02/2010 for the course CIS 200 taught by Professor Staff during the Spring '08 term at Kansas State University.

Page1 / 3

design - Program Design MVC Architecture There are many...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online