{"id":4382,"date":"2014-03-30T10:19:39","date_gmt":"2014-03-30T10:19:39","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/when-might-multiple-inheritance-be-the-only-reasonable-solution-collection-of-common-programming-errors\/"},"modified":"2014-03-30T10:19:39","modified_gmt":"2014-03-30T10:19:39","slug":"when-might-multiple-inheritance-be-the-only-reasonable-solution-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/when-might-multiple-inheritance-be-the-only-reasonable-solution-collection-of-common-programming-errors\/","title":{"rendered":"When might multiple inheritance be the only reasonable solution?-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;d read up on Java Interfaces, and so on, to get a better idea as to the answer to this question. The idea behind an Interface is to create an abstract class that acts as a template for another class. the advantage, here, is that the templates can be combined within a concrete class. For example-<\/p>\n<p>Parent class- FoodStore Subclass- CoffeeShop Subclass- Bakery<\/p>\n<p>With this inheritance tree, a FoodStore can be a Bakery or a CoffeeShop but not both. But then what would we call a Starbucks?<\/p>\n<p>Better way, IMO-<\/p>\n<p>Parent Class- FoodStore Interface- CoffeeShop Interface- Bakery<\/p>\n<p>public class Starbucks extends FoodStore implements CoffeeShop, Bakery { &#8230; }<\/p>\n<p>You&#8217;ll have to know a bit of Java to understand that, but have at it. Interfaces are fairly elementary, IMO.<\/p>\n<p>As a further musing, perhaps Interfaces are designed to obey &#8220;Don&#8217;t repeat yourself.&#8221; Obvious, now that I mention it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;d read up on Java Interfaces, and so on, to get a better idea as to the answer to this question. The idea behind an Interface is to create an abstract class that acts as a template for another class. the advantage, here, is that the templates can be combined within a concrete class. For [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4382","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4382"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4382\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}