Implementing the composite design-pattern using dictionaries [1]