1

Could someone please help me with this simple question? I'm new to UML and I'm studying Iterator Design Pattern.

enter image description here

What does the solid arrow from ConcreteIterator to ConcreteAggregate stands for?

Thanks

Andy Turner
  • 137,514
  • 11
  • 162
  • 243
  • 4
    A) Check here http://stackoverflow.com/questions/1874049/explanation-of-the-uml-arrows ... well, that black solid arrow isn't on that B) tried your favorite search engine ?! (called prior research) C) do not over-tag ... asking about UML diagrams has **nothing** to do with all the tags that you put on this question! – GhostCat Jul 25 '16 at 13:46
  • 1
    the arrow is association (number 5 in answer linked above), only the author of the diagram in your image used non-standard style for the arrow end – Peter Uhnak Jul 25 '16 at 13:56
  • 1
    Take a look at the correct class diagram for Iterator design pattern. http://www.blackwasp.co.uk/iterator.aspx Remember that in UML almost everything is important in the arrow - the type of line, if the arrow is open or closed, if it is empty or filled, if there is additional stereotype or other markings on line (small triangle), over line (also small triangle) and arrow end (can be up to 3 different elements there). I would say only bends (number nor location) has no impact on the meaning of an arrow. – Ister Jul 25 '16 at 14:36

1 Answers1

2

The two arrows between ConcreteAggregate and ConcreateIteraor are not valid in a class diagram. The black solid arrow from ConcreateIteraor and ConcreteAggregate is the notation for an extension between a stereotype and a metaclass. This is not valid between classes and it is not what this diagram intent to describe.

The correct notation for this diagram is:

enter image description here

With a dependency from ConcreteAggregate to ConcreateIteraor and an unidirectional association from ConcreateIteraor and ConcreteAggregate.

To avoid doing not valid diagrams you should use a real UML modeling tool (as opposite to drawing tool). This one as been made with GenMyModel.

Xaelis
  • 1,609
  • 10
  • 17
  • 1
    You are right. A few comments though: - The original diagram showed the classes Aggregate and Iterator in italics, which means they are abstract. It would be good to show this in your diagram too. - The stereotype <> is redundant, because each dashed arrow is a dependency. - You show multiplicity "1" on the left hand side of the association. Why not show multiplicity "*" on the other side? - To indicate that "aggregate" is a property name and not the association name, it would be good to place the word at the left hand side of the association, more near the arrowhead. – www.admiraalit.nl Jul 26 '16 at 07:15
  • One final comment: The gear wheel symbol is not standard UML. I would prefer to show just a "+" sign. – www.admiraalit.nl Jul 26 '16 at 07:21
  • Thank you @www.admiraalit.nl I have fixed the abstract nature and hide the <> stereotype. – Xaelis Jul 26 '16 at 07:29
  • You should have removed the cogwheel icons too and just left the + symbol. Else it would be sort of funny to pinpoint one wrong graphical representation and use another wrong one elsewhere. – qwerty_so Jul 26 '16 at 11:44
  • 1
    @ThomasKilian I have update the diagram, but using the wrong arrow, that could lead to misunderstanding like in this exemple, or using icons to help reading diagrams is not the same thing to me. – Xaelis Jul 26 '16 at 15:31
  • I agree. But I also think that making a baroque appeal is not helpful, though some tool designer seem to think it would. – qwerty_so Jul 26 '16 at 16:25