lundi 30 août 2021

Why are there different ways to describe same design pattern using UML? What to trust?

I find it difficult to learn both Design Pattern and UML since there are different ways to describe the same pattern which make me unsure what is the single source of truth.

Take Iterator pattern for example, here are just a few diagrams that I saw from well-known sites:

1 WIKIPEDIA

https://en.wikipedia.org/wiki/Iterator_pattern

enter image description here

2 TUTORIALS POINT

https://www.tutorialspoint.com/design_pattern/iterator_pattern.htm

enter image description here

3 REFACTORING GURU

https://refactoring.guru/design-patterns/iterator

enter image description here

4 OODESIGN

https://www.oodesign.com/iterator-pattern.html

enter image description here

5 HOWTODOINJAVA

https://howtodoinjava.com/design-patterns/behavioral/iterator-design-pattern/

enter image description here

What confuses me the most is how arrow symbols are used to describe the relationship between these classes. Sometimes they are generalization, sometimes interface realization, directed association or dependency. Even composition is also used...

I wonder what would be the best way for me to get my head around all this.

Aucun commentaire:

Enregistrer un commentaire