Chapter 7. Behavior
John Von Neumann contributed one of the primary metaphors of computing—a sequence of instructions that are executed one by one. This metaphor permeates most programming languages, Java included. The topic of this chapter is how to express the behavior of a program. The patterns are:
• Control Flow—Express computations as a sequence of steps.
• Main Flow—Clearly express the main flow of control.
• Message—Express control flow by sending a message.
• Choosing Message—Vary the implementors of a message to express choices.
• Double Dispatch—Vary the implementors of messages along two axes to express cascading choices.
• Decomposing Message—Break complicated calculations into cohesive chunks.
• Reversing Message—Make control flows ...
Get Implementation Patterns now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.