Comp 212 Lab 09: Koch Curves MVC


Introduction

This tutorial will lead you through the process of putting together an MVC design for the Koch Curves programming project #2.  Your labbies will help divide the lab class into three groups:

Here is roughly how you should budget the lab time to carry out the design process.

The labbies will help manage the time, facilitate the discussion, and serve as consultants. In the end, the whole lab class should come up with an appropriate MVC design for the Koch GUI application and a (perhaps partial) implementation of each of the components of the MVC design.   You can use your lab work to complete milestone 2  for programming project #2.  

Code sharing is allowed between members of the same lab section only. Suggestion: one member of each group should make a publicly readable directory where shared code is placed. Be sure to tell your lab section where that directory can be found!


Koch Curve View

It is perhaps more convenient to look at the view first.  From the demo applet, we see that the view frame has the following required GUI components.

  1. What it looks like.
  2. What it behaves like.
  3. How it is created and initialized.

Koch Curve Model

It is important to recognize that the model for the Koch curve GUI application is not simply the Koch curve class and its abstract factory designed in milestone 1.  To have a working  the model for the Koch GUI application, we will need to write the code for the Koch curve class and at least  four concrete Koch curve factories as shown in the demo and put them together in such a way that they can work together and carry out the task required by the GUI application.   Assuming you have written such code, the Koch curve model for the required application have the following properties and behaviors.

  1. What it looks like- The model for the Koch GUI application maintains
  2. What it behaves like
  3. How it is created and initialized.

Koch Curve Controller

The Koch controller instantiates the model and the view, and set up the "wiring" between the two using appropriate adapter.

  1. What it looks like - The controller maintains
  2. What it behaves like.
  3. How is it created and initialized.
 
D. X. Nguyen, Oct. 28, 2001
dxnguyen@cs.rice.edu