{"id":233,"date":"2003-01-23T22:47:14","date_gmt":"2003-01-24T02:47:14","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=233"},"modified":"2003-01-23T22:47:14","modified_gmt":"2003-01-24T02:47:14","slug":"on-object-oriented-design","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2003\/01\/23\/on-object-oriented-design\/","title":{"rendered":"On object-oriented design"},"content":{"rendered":"<p>On object-oriented design: &#8220;&#8230; Should I derive the class Polyline from the class Point?  This has fairly obvious answer.  A Polyline is clearly not a kind of point, so it is not logical to derive the class Polyline from the Point class.  This is an elementary demonstration of what is often referred to as the &#8216;<b>is a<\/b>&#8216; test.  If you can say that one kind of object &#8216;is a&#8217; specialized form of another kind of object you may have a good case for a derived class&#8230;. The complement to the &#8216;is a&#8217; test is a &#8216;<b>has a<\/b>&#8216; test.  If one object &#8216;has a&#8217; component that is an object of another class, you have a case for a class member. A House object &#8216;has a&#8217; door, so a Door variable is likely to be a member of the class House.&#8221; [pg 254 of <a href=\"http:\/\/www.amazon.com\/exec\/obidos\/ASIN\/1861003668\/cephasnet-20\/\">Beginning Java 2<\/a>]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On object-oriented design: &#8220;&#8230; Should I derive the class Polyline from the class Point? This has fairly obvious answer. A Polyline is clearly not a kind of point, so it is not logical to derive the class Polyline from the Point class. This is an elementary demonstration of what is often referred to as the &hellip; <a href=\"https:\/\/cephas.net\/blog\/2003\/01\/23\/on-object-oriented-design\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">On object-oriented design<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/233"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=233"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/233\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}