the Command Pattern, based on Head First Design Patterns book.