We're going to create a simple system to manage a quick-and-dirty to-do list. The very first thing we need to create, then, is a Task:
Notice that the Task class must implement java.io.Serializable, and all its fields must be serializable, too.
Then, we proceed to create a TaskList:
On this TaskList, we have two methods that change the data on our system: addTask() and removeTask(). Because of the way Prevayler works (saving every change to the system, instead of the data itself), we must wrap any calls to these methods inside Transaction objects (Command Pattern).
Labels:
