vendredi 7 février 2020

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