aspose file tools*
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
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: 24187
    
  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: 24187
    
  34

Anything that makes code unnecessarily hard to understand is a bad thing, and excessively deep inheritance is one of those things.
 
Consider Paul's rocket mass heater.
 
subject: Interface Inheritance