examples of implementing 'composite pattern'