©2009 Felleisen, Proulx, et. al.

12  User Interactions

Goals

In this lab you will learn a little about programming user interactions using the Model-View-Control pattern for organizing the responsibilities.

The JPT library allows you to concentrate on the key concepts and avoid the pitfalls of multitude of details, typically associated with GUI programming.

The Model and the View

The diagram below (on the next page) describes the classes already included in this application:

Here is a brief description of the role these files play in the application.

The model

The program deals with balloons (for now just three of them).

The views

We can view the information about a particular Balloon object in several different ways. The BalloonInput interface provides two methods for getting the data needed to construct an instance of a new Balloon.

To display the information about a Balloon object, we can print a String that represents the Balloon object in the console, or paint it in the given window, or display the values of its fields in a GUI.

To get the data from the user that is needed to instantiate a new
Balloon we can read from the console, or from a GUI.

Last modified: Tuesday, December 1st, 2009 6:10:24pm