| Author |
UML question: aren't dotted lines only used for for "implements"?
|
Chandella Montero
Ranch Hand
Joined: Feb 18, 2011
Posts: 89
|
|
Hello, I'm studying for my SCJA using McKenzie's book, and I just came across something strange. On page 163, the Full Shapes Class Diagram shows the relationship between Line and Shape using a dotted line (and it uses a dotted line again to represent the relationship between Point and Shape).
However, the "UML for the Java Associate" document that I downloaded from this forum (by the same authors who did Head First Java), says that dotted lines are used when a class implements an interface. It means "implements" rather than "extends".
If you look at the code for Line and Point in McKenzie's book, a few pages before, they clearly "extend" Shape, they don't "implement" it.
Is this a mistake in the book? Or is there another explanation for it?
Thank you for your help!
|
OCA, OCP Java 6
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4967
|
|
Hmmmm...Let me check that.
Indeed, Shape is an interface, and classes always implement interfaces, whereas only interfaces can extend interfaces.
|
Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
|
 |
Chandella Montero
Ranch Hand
Joined: Feb 18, 2011
Posts: 89
|
|
Thank you, Cameron. At that point in the book, though, Shape is still a class, right? So shall I just replace the dotted line with a solid line?
Thank you very much for your help, I've only just started learning Java and everything is still pretty new to me. Just wanted to make sure I got it right.
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: UML question: aren't dotted lines only used for for "implements"?
|
|
|