design pattern: composite pattern