composite-transparency-vs-safety-tradeoff

Status: IN

The Composite pattern involves a transparency-vs-safety tradeoff: declaring child management (Add/Remove) in Component gives transparency (uniform treatment) but allows meaningless operations on Leaves; declaring it only in Composite gives compile-time safety but different interfaces for Leaves and Composites.

Source: entries/2026/06/17/gof-oo-chunk-12.md

Depended on by

JSON