Iteration 2 proposal - Athear/Machine-shop-simulator Wiki

Inappropriate Intimacy Class methods still have too many references to other class' fields, even through getter methods.

Proposed Refactoring: Replaces references or calls to getter methods with input variables for the methods where they are used. The main thing here is to remove references to MachineShopSimulator get methods from other classes.

Technical Difficulty: Low difficulty. The challenge with this will be cleaning up the variables, and how many variables each method requires.

Impact on Code: Medium. This refactoring will clean up the readability of the larger methods in Machine and Job classes.

Large Methods changeState and inputData are huge methods that should probably be broken down or rearranged to be smaller.

Proposed Refactoring: remove nested if/else clauses and nested for loops in each. Reduce redundant loops or if checks in inputData

Technical Difficulty: Medium. This shouldn't be too difficult, but it will likely be harder than we anticipate. We will need to find ways to either condense logic or extract it into a new function.

Impact on Code: Large. Improving the readability of these methods, especially inputData, will go a long way toward making the code understandable for someone new to the project.

Superfluous Class EventList contains no logic that would not be better off in Machine (or a MachineArray class).

Proposed Refactoring: Change the machine array such that it can be sorted (next to finish machine at index 1). Have Machine store finishing times, potentially their ID number. This may involve creating a Machine Array class.

Technical Difficulty: Hard. This requires removing dependencies on the order of the machines, which may or may not exist. This will also require altering ALL references to eList, of which there are a lot.

Impact on Code: Large. We're removing a dang class. This will clarify many of the things happening anywhere that involves machines.