Java Arena

Module 25

Separating the UI from program logic

Programs that take commands from the user. A loop that reads commands until the user quits, remembering what later commands need, moving the program's logic into a class of its own, a user interface class that takes a Scanner, changing how a class works inside without changing the code that uses it, adding a feature, and planning a whole program. MOOC section 6.2.

Steps

  1. A loop that reads commands
  2. Remembering between commands
  3. The program's logic in a class
  4. A class for the user interface
  5. Changing a class without changing its users
  6. Adding a feature
  7. Planning a whole program