{"id":"filtering-iterator-demonstrates-template-method-composability","text":"FilteringIterator's use of Template Method (TestItem and ProcessItem as primitive operations) demonstrates that Template Method serves as a composability mechanism between patterns: Iterator provides the traversal skeleton while Template Method's hook/abstract-operation distinction enables per-element filtering and processing to be varied independently, showing that Template Method functions as a fine-grained integration point between patterns, not just within a single class hierarchy.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["gof-filtering-iterator-adds-testitem","template-method-dual-role-skeleton-and-safety"],"outlist":[],"label":"FilteringIterator exemplifies Template Method as an inter-pattern integration mechanism"}],"dependents":["template-method-bridges-inheritance-composition-at-all-scales"],"metadata":{"source_type":"derived","review_result":"unnecessary"},"created_at":"2026-06-18T01:48:10+00:00","updated_at":"2026-06-18T06:15:08+00:00","reviewed_at":"2026-06-18T06:15:08+00:00","verified_at":"","retracted_at":"","explanation":{"steps":[{"node":"filtering-iterator-demonstrates-template-method-composability","truth_value":"IN","reason":"SL justification valid","antecedents":["gof-filtering-iterator-adds-testitem","template-method-dual-role-skeleton-and-safety"],"label":"FilteringIterator exemplifies Template Method as an inter-pattern integration mechanism"},{"node":"gof-filtering-iterator-adds-testitem","truth_value":"IN","reason":"premise"},{"node":"template-method-dual-role-skeleton-and-safety","truth_value":"IN","reason":"SL justification valid","antecedents":["template-method-principled-inheritance-counterexample","observer-consistency-via-template-method"],"label":"Template Method's override control and its Observer safety role are two manifestations of the same Hollywood principle, revealing it as both the exception that proves the composition rule and the mechanism that makes composition-based notification safe"},{"node":"template-method-principled-inheritance-counterexample","truth_value":"IN","reason":"SL justification valid","antecedents":["template-method-fine-grained-override-control","composition-superiority-for-reuse"],"label":"Template Method is the exception that proves the composition rule by showing when inheritance works"},{"node":"template-method-fine-grained-override-control","truth_value":"IN","reason":"SL justification valid","antecedents":["gof-template-method-five-operation-kinds","hook-operations-overridable-defaults","gof-cpp-template-method-nonvirtual"],"label":"Five operation kinds plus non-virtual skeleton produce the most controlled inheritance in the GoF"},{"node":"gof-template-method-five-operation-kinds","truth_value":"IN","reason":"premise"},{"node":"hook-operations-overridable-defaults","truth_value":"IN","reason":"premise"},{"node":"gof-cpp-template-method-nonvirtual","truth_value":"IN","reason":"premise"},{"node":"composition-superiority-for-reuse","truth_value":"IN","reason":"SL justification valid","antecedents":["favor-composition-over-inheritance","inheritance-breaks-encapsulation","inheritance-compile-time-composition-run-time","delegation-composition-as-powerful-as-inheritance"],"label":"Four independent arguments converge on composition's superiority over inheritance"},{"node":"favor-composition-over-inheritance","truth_value":"IN","reason":"premise"},{"node":"inheritance-breaks-encapsulation","truth_value":"IN","reason":"premise"},{"node":"inheritance-compile-time-composition-run-time","truth_value":"IN","reason":"premise"},{"node":"delegation-composition-as-powerful-as-inheritance","truth_value":"IN","reason":"premise"},{"node":"observer-consistency-via-template-method","truth_value":"IN","reason":"SL justification valid","antecedents":["gof-observer-notify-after-consistent-state","gof-template-method-hollywood-principle"],"label":"Observer's consistency requirement and Template Method's inverted control connect as enforcement mechanism to correctness constraint"},{"node":"gof-observer-notify-after-consistent-state","truth_value":"IN","reason":"premise"},{"node":"gof-template-method-hollywood-principle","truth_value":"IN","reason":"premise"}]}}