不太理解the design pattern java companion一书中的Command
已经建立了
class btnRedCommand extends Button implements Command {...}
class fileExitCommand extends MenuItem implements Command {..}
等等这些类
但注册的时候为什么还是用fileOpen(),fileExit()这些方法?这些方法是没有使用COMMAND模式之前所采用的方法呀!!
mnuOpen.addActionListener(new fileOpen());
mnuExit.addActionListener(new fileExit());
请指点!!!
具体请看http://www.patterndepot.com/put/8/command.pdf