File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark ""Is -A" relationship" Watch ""Is -A" relationship" New topic
Author

"Is -A" relationship

Rob Michaelson
Ranch Hand

Joined: Jul 15, 2003
Posts: 36
What is the �Is-A� relationship?
chi Lin
Ranch Hand

Joined: Aug 24, 2001
Posts: 348
Rob,
"is-A" relationship used on inheritance to describe parent/child realtionship.
eg :
Occupation class as parent class,
Programmer, CabDriver being child class of Occupation.
in Java we say
Programmer extends Occupation
CabDriver extends Occupation
we then decribe the relationship like :
Programmer is-A Occupation
CabDriver is-A Occupation
[ July 21, 2003: Message edited by: chi Lin ]

not so smart guy still curious to learn new stuff every now and then
Rob Michaelson
Ranch Hand

Joined: Jul 15, 2003
Posts: 36
That is great - Thank You!!
R
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Is-A is a helpful way to hunt for opportunities for inheritance, but it is not the only way and it is not always right and inheritance is not the only way to "be" something else. So if you see something in the real world that "is a" something else but inheritance makes no sense in code, listen to the code.
When using inheritance, you should also be aware of the Liskov Substitution Principle. Do a Google search for papers and see how it complicates the simple "Is-A" some times.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: "Is -A" relationship
 
Similar Threads
compare object
WA #1.....word association
use an instance that is created
a uml question
How to refresh the main window once we close the popup