Tino APCS

Lab 7.1 MS Model Interface

Reading

If you haven't done so yet, read Java FX Lesson 7 Page A.

Overview

The MSModel interface is a list of public methods the controller can call on the model to either tell it to perform an action (i.e. updating the data) or ask it for information. For example, what information needs to be known in order to decide which image to show at a given cell? You need methods to get that information. You also need to be able to tell the model to reveal a cell. What other information do you need about the model? What actions need to be performed?

  • How will your Controller talk to the Model?

  • What questions will your Controller need to ask the Model?

  • What actions will the controller tell the model to take?

  • These questions and actions will be defined in MSModelInterface, which will be an interface implemented by the Model and used by the Controller.

Directions

Write the MSModelInterface, which is the interface defining how the Controller interacts with the Model. It is a list of questions and commands the Controller can ask/tell the Model. Think of everything the Controller may need to ask the Model and include it in your interface. At no point, however, should you have a method that gives full access to all of your raw data such as returning the actual array(s) where you keep the data.

Note: Even though the Controller can already access all the public methods of the Model without having an interface we are still using an interface to generalize and standardize the questions being asked. That way, it won't matter how you actually implement your Model as long as your Model can respond to the questions asked of it. In this way, it will be possible to swap your Model with a different Model as long as they both implement the same interface.

File name

Name your file in the format PX_LastName_FirstName_MSModelInterface.java

You must Sign In to submit to this assignment

Dark Mode

Outline