This is the UML for the refactored design:
I eliminated the LivingCells class that appeared in the previous design.
I pushed a lot of code from the GameOfLife class into Generation to eliminate a bit of feature envy. This is GameOfLife's code now:
and this is Generation's one:
I also refactored the tests eliminating all the checks based on strings and using constructors with variadic parameters.
Following the idea in the Clojure version I managed to simplify the Rules interface a lot:
Most of the other changes are just renaming of methods, variables and parameters.
This new code keeps the functionality and characteristics of the previous version but it's much simpler.
No comments:
Post a Comment