{"id":"template-method-dual-role-skeleton-and-safety","text":"Template Method serves a dual architectural role: as the controlled inheritance counterexample (fine-grained override control with five operation kinds) it bounds the composition paradigm, AND as the safety enforcement mechanism (Hollywood principle guaranteeing Observer's pre-notification consistency) it enables reliable pattern composition — the same inversion-of-control mechanism both justifies inheritance in narrow cases and makes composition-based patterns safe.","truth_value":"IN","source":"","source_url":"","source_hash":"","justifications":[{"type":"SL","antecedents":["template-method-principled-inheritance-counterexample","observer-consistency-via-template-method"],"outlist":[],"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"}],"dependents":["filtering-iterator-demonstrates-template-method-composability"],"metadata":{"source_type":"derived","review_result":"pass"},"created_at":"2026-06-18T01:19:55+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":"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"}]}}