{"id":1532,"date":"2022-12-04T19:34:20","date_gmt":"2022-12-05T02:34:20","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=1532"},"modified":"2022-12-04T19:34:20","modified_gmt":"2022-12-05T02:34:20","slug":"fixing-code-by-not-touching-it-follow-up","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2022\/12\/04\/fixing-code-by-not-touching-it-follow-up\/","title":{"rendered":"Fixing code by not touching it follow up"},"content":{"rendered":"\n<p>In the case I described the code is in a subclass a Xojo class<\/p>\n\n\n\n<p>The idea here is to INSERT a new subclass between the existing subclass and the new one. And the newly inserted subclass will expose things in a way the OLD existing code wont break<br><br>So we never touch the old code<br>We just modify the inheritance chain in a way we can then alter how things behave<\/p>\n\n\n\n<p>So in his case we can add a new subclass of EmailMessage that exposes the Source as a Method pair ( get &amp; set) and then make the existing class inherit from our new class<\/p>\n\n\n\n<p>And the existing code will then JUST work without ever having had to alter any of it<br><br>Next time you have an issue like this consider that as an option !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the case I described the code is in a subclass a Xojo class The idea here is to INSERT a new subclass between the existing subclass and the new one. And the newly inserted subclass will expose things in a way the OLD existing code wont break So we never touch the old codeWe &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2022\/12\/04\/fixing-code-by-not-touching-it-follow-up\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Fixing code by not touching it follow up&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[27,6,3],"class_list":["post-1532","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-advanced-techniques","tag-tips","tag-xojo"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=1532"}],"version-history":[{"count":1,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1532\/revisions"}],"predecessor-version":[{"id":1533,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/1532\/revisions\/1533"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=1532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=1532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=1532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}