February 2000
Intermediate to advanced
352 pages
6h 31m
English
The Chain of Responsibility pattern forwards requests along a chain of classes, but the Command pattern forwards a request only to a specific object. It encloses the request for a specific action inside an object and gives it a known public interface. It lets you give the client the ability to make requests without knowing anything about the actual action that will be performed and allows you to change that action without affecting the client program in any way.
When you build a Java user interface, you provide controls—menu items, buttons, check boxes, and so on—to allow the user to tell the program what to do. When a user selects one of these controls, the program receives an ActionEvent, which it must ...
Read now
Unlock full access