/todolist

A simple todo list app to illustrate multi-step undo and redo.

Primary LanguageJava

What this project is about

Build Status

This project is a small todo list app that allows users to add, remove and edit todo list items. The whole purpose of this app is to showcase which patterns to use for undoing/redoing user actions, without changing existing domain classes.

How to run it

  1. Go to the console and enter java -version. It should show that Java is installed and a version >= 8. You can get Java here.
  2. Download the zip file contained in the binaries folder of this project, and unzip it to your hard drive.
  3. Using the console, go to the unzipped folder on your hard drive. Enter the bin folder.
  4. Run the todolist script (Unix) or the todolist.bat script (Windows).

How it works internally

  • The TodoList class represents the domain knowledge: you can add, remove and edit items. A simple, zero-based index called itemNumber is used to access specific items.
  • The UndoableTodoList class is an adapter to the TodoList class that implements the same interface. Besides delegating to its own TodoList instance, it also keeps tracks of undo/redo commands.