Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Part II: Patterns > Command Pattern

Chapter 10. Command Pattern

In This Chapter

Understanding the Command Pattern 137

Building a Simple Command Application 139

Making Commands Undoable and keeping Command histories 146

Building an Undoable Application 148

Building a Redoable Application 153

Using Commands to Build a Proximity game 154

Summary 168

The Command pattern encapsulates functionality into a class. Although the pattern might appear simplistic, don’t let its simplicity deceive you. The Command pattern is a powerful way for enabling a range of features that would be difficult to implement using a different approach. Here are some of the most common uses of the Command pattern:


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial