composite and iterator patterns