Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interface Inheritance

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys, I find myself using Inheritance through Interfaces more and more. Is this ok or is this as bad as Class inheritance?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24212
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anything that makes code unnecessarily hard to understand is a bad thing, and excessively deep inheritance is one of those things.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic