dimanche 18 octobre 2015

Which pattern for console menu with submenu in Java?

In Java I want to create a ConsoleMenu object which prints a menu like

1. Open File
2. Edit Settings
3. Display Credits

Answer: _

Let's say the user enters 3, then a ConsoleCreditView object displays the credits until any key is hit, then it hands back control to ConsoleMenu and the console is reinitialized with the main menu.

What would be an appropriate object oriented pattern for such a situation?

Aucun commentaire:

Enregistrer un commentaire