{"id":2759,"date":"2023-10-16T12:51:43","date_gmt":"2023-10-16T11:51:43","guid":{"rendered":"https:\/\/andyjohnson.uk\/blog\/?p=2759"},"modified":"2023-10-16T13:04:56","modified_gmt":"2023-10-16T12:04:56","slug":"slotd-pushing-the-model","status":"publish","type":"post","link":"https:\/\/andyjohnson.uk\/blog\/2023\/10\/16\/slotd-pushing-the-model\/","title":{"rendered":"SLotD: Pushing the model"},"content":{"rendered":"\n<p><em>Software Lesson of the Day for 16\/10\/2024:<\/em><\/p>\n\n\n\n<p>Sometimes you will try something and it works. And then you extend it a bit. And then a bit more. And it stops working and\/or doing what you want.<\/p>\n\n\n\n<p>Consider the possibility that the fact it initially worked was just a false signal, and that actually you should never have done it that way at all. Because the model or pattern for doing <code>$thing$<\/code> is actually somewhat different \u2014 and whether you approve of that pattern or not, and whether you like deleting superficially working code or not, that&#8217;s the way you have to do it. Because we rarely write software nowadays without what we write having to fit into a more or less opinionated container. So make sure you <em>actually<\/em> understand the pattern, not simply what you want it to be.<\/p>\n\n\n\n<p>(This post is brought to you by trying to implement an Android <code>ViewPager<\/code> with hard-coded child elements in the layout xml. No matter how hard you try, you can never defeat the <code>PagerAdapter<\/code>&#8216;s beliefs about page instantiation and caching.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Software Lesson of the Day for 16\/10\/2024: Sometimes you will try something and it works. And then you extend it a bit. And then a bit more. And it stops working and\/or doing what you want. Consider the possibility that the fact it initially worked was just a false signal, and that actually you should &hellip; <a href=\"https:\/\/andyjohnson.uk\/blog\/2023\/10\/16\/slotd-pushing-the-model\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SLotD: Pushing the model&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[43,42,27],"class_list":["post-2759","post","type-post","status-publish","format-standard","hentry","category-development","tag-development","tag-software","tag-tech"],"_links":{"self":[{"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/posts\/2759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/comments?post=2759"}],"version-history":[{"count":3,"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/posts\/2759\/revisions"}],"predecessor-version":[{"id":2766,"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/posts\/2759\/revisions\/2766"}],"wp:attachment":[{"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/media?parent=2759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/categories?post=2759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/andyjohnson.uk\/blog\/wp-json\/wp\/v2\/tags?post=2759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}