@startuml skin rose skinparam BackgroundColor transparent skinparam GenericDisplay old skinparam componentStyle rectangle ' skinparam Shadowing false hide members left to right direction component "List" as ListDog component "IEnumerable" as IEnumerableDog { component "List" as ListDogInner } component "IEnumerable" as IEnumerableAnimal { component "IEnumerable" as IEnumerableDogInner { component "List" as ListDogInner2 } } () " " as DogIterator () " " as AnimalIterator together { component "Action" as ActionDogContainer { component "Action" as ActionAnimalInner } component "Action" as ActionAnimal component "Action" as ActionDog } ' Control layout ActionDogContainer -[hidden]> ActionDog ActionDog -[hidden]> ActionAnimal ActionDogContainer --> ActionAnimalInner ListDog --> DogIterator : iterate Dogs ListDogInner --> IEnumerableDog : iterate Dogs IEnumerableDog --> DogIterator : iterate Dogs DogIterator --> ActionDogContainer : accept Dog DogIterator --> ActionDog : accept Dog DogIterator --> ActionAnimal : "\naccept Dog" ListDogInner2 --> IEnumerableDogInner : iterate Dogs IEnumerableDogInner --> IEnumerableAnimal : iterate Dogs IEnumerableAnimal --> AnimalIterator : iterate Animals AnimalIterator --> ActionAnimal : accept Animal @enduml