I'll create a summary entry from this index material.
GoF Design Patterns: Index Cross-References (R-X)
This section covers the book's index entries from R through X, revealing the interconnections between patterns, their participants, and the systems that use them. The index serves as a map of pattern relationships, implementation languages, and real-world applications referenced throughout the book.
Key Concepts
Reuse mechanisms: Three primary forms — black-box (composition, 19), white-box (subclassing, 19), and parameterized types (templates/generics, 21). Black-box reuse is generally preferred.
Designing for reuse: Frameworks (26), toolkits (26), and internal reuse (25) are the main vehicles. Maximizing reuse is a core design goal (23).
Request: A fundamental OO concept (11) — can be encapsulated (COMMAND), forwarded automatically (CHAIN OF RESPONSIBILITY), sequenced (234), and guaranteed receipt (226).
Sender-receiver decoupling: A recurring theme (346) achieved through COMMAND, CHAIN OF RESPONSIBILITY, MEDIATOR, and OBSERVER.
State management: Extrinsic vs. intrinsic state (196, FLYWEIGHT), incremental state changes (287, MEMENTO), sharing state (308, FLYWEIGHT), and atomic state transitions (308, STATE).
Type vs. class distinction: Type defines interface, class defines implementation (13, 16). Subtypes and supertypes relate to interface conformance, not inheritance.
Terminal vs. nonterminal symbols: In INTERPRETER, terminal symbols can be shared using FLYWEIGHT (247).
Traversal responsibility: In VISITOR and ITERATOR, deciding who controls traversal (the aggregate, the iterator, or the visitor) is a key design decision. Traversal can be inorder, preorder, or postorder (262).
Commands and Syntax
No new commands in this section. Key implementation notes from index references:
SINGLETON in C++: Implementation details at pages 129, 131; subclassing considerations at 130; registry-based approach at 130.
STATE in C++: Uses the envelope-letter idiom; table-driven state transitions as an alternative to subclass-per-state (308).
TEMPLATE METHOD: Naming conventions for hook methods at 329; calls FACTORY METHOD (116).
Templates (C++ parameterized types): Used to implement COMMAND (239), FACTORY METHOD (113), STRATEGY (319, 323).
VISITOR in Smalltalk: Combined with INTERPRETER (247, 255); compiler example (190, 331).
SINGLETON + ABSTRACT FACTORY: SINGLETON used to implement ABSTRACT FACTORY (90).
OBSERVER subjects: Can be combined with Observer in one object (300); must avoid dangling references (297); support mapping to multiple observers (297).
Unidraw framework: Uses 9 patterns (ADAPTER, CHAIN OF RESPONSIBILITY, COMMAND, FACTORY METHOD, ITERATOR, MEDIATOR, MEMENTO, OBSERVER, PROTOTYPE, STATE) — exemplifies heavy pattern usage in real frameworks.
Exam-Relevant Points
Three reuse mechanisms: Composition (black-box), inheritance (white-box), parameterized types — know tradeoffs of each.
Type ≠ class: Type is about interface conformance; class is about implementation. Definitions vary by language (C++ at 17, Eiffel at 17, Smalltalk at 17).
STRATEGY is optional: The Strategy participant can be made optional (320), unlike most pattern participants.
State transition approaches: Subclass-per-state vs. table-driven (308) — know when each is appropriate.