Lecture 13: Command-Driven Dispatching

Ambient Temperature: 73.2oF

Concepts

  1. Dr. Wong explains how proper MVC design facilitates launching ballworld as a Java Applet, by showing how the demo pages’ code was set up and invoked.
  2. Dr. Wong demonstrates “Infection Balls,” “Eating Balls,” and “Bouncing Balls” as part of the command-driven ballworld demo.
  3. Some pool halls have cue balls that are smaller than normal.
  4. Strategies are used with a specific purpose in the mind (paint, update, etc) of the object that uses them. Commands are used without any specific purpose in the mind of the object that uses them. IPaintStrategy may have a paint() method, IUpdateStrategy will have an update() method, etc. When these methods are called in code, the object calling them will be calling .paint() because it wants to paint. An ICommand will have only an apply() method, and when a command is run in code, the object running it won’t know why, or what the command does – only that it should run the command.

Resources

  1. Oracle’s Java Applet Tutorial: http://docs.oracle.com/javase/tutorial/deployment/applet/
  2. Lecture 13 webpage: http://www.clear.rice.edu/comp310/f12/lectures/lec13/