Remove GUI state maintenance of other classes from MapContainer to adhere to proper MVC design

Issue #351 new
Robert Leach created an issue

USE CASE: WHAT DO YOU WANT TO DO?

Follow proper MVC design

STEPS TO REPRODUCE AN ISSUE (OR TRIGGER A NEW FEATURE)

Inspect the variables maintained in MapContainer that are controlled from other classes.

CURRENT BEHAVIOR

MapContainer is used as a hub for communication between classes that do not talk directly to one another. That data is kept up to date in real time, but the classes that use that data for figuring out what to draw use timers to "sample" that state at its own pace. This prevents overwhelming the interface with multiple graphical updates that are unnecessary at the rate at which they occur if we were to use a notifyObservers strategy. However, MapContainer is the Model component of an MVC design, and therefore, it should not need to know or maintain all this GUI state data.

EXPECTED BEHAVIOR

What we would like to do is separate the source scientific data in the model from the data generated by interactions with the application. The view is generated based on the states contained in the model, but in this instance, there's the pure scientific data, and then there's the state of where the user is in the data, because each view has different limitations of how much data can be viewed in it. We want that separation to be reflected in the classes.

DEVELOPERS ONLY SECTION

SUGGESTED CHANGE (Pseudocode optional)

Create a hub class that contains state data for the GUI which the view classes can sample at their own pace. This will basically remove GUI knowledge from the MapContainer class.

FILES AFFECTED (where the changes will be implemented) - developers only

MapContainer LabelView TRView InteractiveMatrixView possibly other controller classes.

LEVEL OF EFFORT - developers only

medium

COMMENTS See PR 32.

Comments (2)

  1. Robert Leach reporter
    • removed milestone

    Removing milestone: Coding Convention Adherence (automated comment)

  2. Log in to comment