Composite Design Pattern how to restrict the components from creating endless recursion
In Composite Design Pattern, from its recursive nature, I might end up with an endless loop and create a cycle. How can I enforce some kind of validity-checks in my code to secure that I haven't created any cycles when calling the operation method?
Aucun commentaire:
Enregistrer un commentaire