This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Question on Command pattern from GoF book Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Question on Command pattern from GoF book" Watch "Question on Command pattern from GoF book" New topic
Author

Question on Command pattern from GoF book

Sai Swami
Ranch Hand

Joined: Sep 24, 2002
Posts: 51
Hi Ranchers,

Had a quick question on the Command pattern:

The Structure diagram of Command pattern in the GoF book shows a straight arrow of "Client" towards "Receiver" and a dotted arrow from "Client" to "ConcreteCommand".

Can anyone please tell me why a straight line and a dotted line if they both mean the same thing that there is a reference.


Thanks in advance,
Sai
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1753
    
    7

The dotted arrow models a dependency, while the solid arrow models an association.

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Sai Swami
Ranch Hand

Joined: Sep 24, 2002
Posts: 51
Thanks a lot Jelle !
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question on Command pattern from GoF book
 
Similar Threads
Rational XDE - create stereotype ?
about Proxy pattern
how do i draw a dotted straight line on an applet.
Converting and casting.
how to capture white space