Iteration 2 Final Writeup - Athear/Machine-shop-simulator GitHub Wiki

The first biggest thing we tackled was removing EventList class. This addressed the self proclaimed superfluous class smell from our write up. We accomplished this by first making machine class aware of finishTime. We also moved the functionality to MachineShopSimulator (MSS). This were a lot more baby step changes we did but its hard to look back and remember. We feel great improved the code and architecture.

We address the large method smell by breaking down down inputData(), in MSS, into three methods. Were inputData() created and populated the machine array we extracted into its own method. We did the same where it created Jobs.

For the inappropriate intimacy smell we removed all the references to machine array in the machine and job classes. We also removed calls to static machine shop variables from machine and job. And we didn't appreciate how entangled the job and machine were. There are still some inappropriate intimacies left. For example we could have made getters and setters for these classes.

An addition thing we did was convert machine array into a treeMap. This allowed us to change all the for loops referencing machine array to for each loops of the machines in the treeMap. We were originally going to use just a hashmap but it turned out we needed a sorted map instead since the tests expect an order. This this was mild work around for the indices starting at one. Other mild changes involved cleaning up comments and renaming variables.