*
The moose likes Java in General and the fly likes Interface Inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Interface Inheritance" Watch "Interface Inheritance" New topic
Author

Interface Inheritance

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Hi guys, I find myself using Inheritance through Interfaces more and more. Is this ok or is this as bad as Class inheritance?


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Anything can be abused, of course. For example, a chain of interfaces extending other interfaces that went four or five deep would definitely make me raise an eyebrow. But in its place, inheritance of interfaces is a perfectly good tool in the toolbox.


[Jess in Action][AskingGoodQuestions]
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
Kewl! So I can safely conclude that inheritance, interface or class when it goes down too deep could be a bad thing huh? Thanks!
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Anything that makes code unnecessarily hard to understand is a bad thing, and excessively deep inheritance is one of those things.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Interface Inheritance