wood burning stoves 2.0*
The moose likes Associate Certification (SCJA,OCAJ 5/6) and the fly likes UML question: aren't dotted lines only used for for Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Associate Certification (SCJA,OCAJ 5/6)
Bookmark "UML question: aren Watch "UML question: aren New topic
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: 4968

Hmmmm...Let me check that.

Indeed, Shape is an interface, and classes always implement interfaces, whereas only interfaces can extend interfaces.
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: http://aspose.com/file-tools
 
subject: UML question: aren't dotted lines only used for for "implements"?
 
Similar Threads
Does Cameron McKenzie book
Line has two points: asociation or composition?
Polymorphism question
Accessing inherited attributes in TogetherJ
Question related to dynamic resue of objects