itoshkov / nand2tetris-emu

Nand2Tetris Software Suite - hardware simulator and CPU and VM emulators
http://www.nand2tetris.org
GNU General Public License v2.0
90 stars 29 forks source link

Fix the architecture #11

Open itoshkov opened 7 years ago

itoshkov commented 7 years ago

One of the biggest issues with the current tools is their architecture.

There are lower level parts, which technically don't know about the GUI. But they are written in a way that they control the GUI, so the interfaces between them are very fat. Take for example ControllerGUI.java. There are methods like enableRewind, disableRewind which make the lower level emulator control the GUI.

It would be much better to have it the other way around and the GUI to control the lower level emulator. It may need some notifications from the lower levels, for which it should be able to register some call-backs.