frontend
Safe composite
Keep child-management operations only on composite nodes so leaves stay simpler and safer.
Intent: Avoid exposing meaningless tree operations on leaf nodes.
Problem: A fully uniform API can make leaf objects look like containers even when they are not.
Solution: Limit child manipulation to composite nodes while keeping shared read-only behavior common.
Dependencies
Related variants
Examples
Useful when you want clearer boundaries between leaves and branches.