{"id":256,"date":"2018-11-12T14:26:33","date_gmt":"2018-11-12T14:26:33","guid":{"rendered":"http:\/\/fip.r-a-w.org\/?p=256"},"modified":"2018-11-12T14:26:33","modified_gmt":"2018-11-12T14:26:33","slug":"refactoring-open-closed-principle-applied-to-jobman","status":"publish","type":"post","link":"https:\/\/fip.r-a-w.org\/?p=256","title":{"rendered":"Refactoring &#8211; Open Closed Principle applied to JobMan"},"content":{"rendered":"<p>The MainJob and Replicator classes could turned to Abstract or I could introduce new base classes. I had previously deleted the Job class but this needs reinstating with MainJob extending Job. Then there could also be a replication base class that then extends the Job class functionality and introduces the functionality associated with spawning a Job. The base class in this instance could be referred to as SpawnableJob. I have chosen to introduce base classes mainly because I prefer the names of the base classes.<\/p>\n<p>In future Job Classes could have further functionality added e.g a job with attached documents.<\/p>\n<p>This would require minimum amendments to the JobDatabase class.<\/p>\n<p>The class diagram now looks like this:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?ssl=1\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"263\" data-permalink=\"https:\/\/fip.r-a-w.org\/?attachment_id=263\" data-orig-file=\"https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?fit=1883%2C1782&amp;ssl=1\" data-orig-size=\"1883,1782\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"jobman12-11-18\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?fit=700%2C662&amp;ssl=1\" class=\"alignnone size-large wp-image-263\" src=\"https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?resize=700%2C662&#038;ssl=1\" alt=\"\" width=\"700\" height=\"662\" srcset=\"https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?resize=1024%2C969&amp;ssl=1 1024w, https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?resize=300%2C284&amp;ssl=1 300w, https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?resize=768%2C727&amp;ssl=1 768w, https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?resize=700%2C662&amp;ssl=1 700w, https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?resize=423%2C400&amp;ssl=1 423w, https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?w=1883&amp;ssl=1 1883w, https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/jobman12-11-18.png?w=1400&amp;ssl=1 1400w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The MainJob and Replicator classes could turned to Abstract or I could introduce new base classes. I had previously deleted the Job class but this needs reinstating with MainJob extending Job. Then there could also be a replication base class that then extends the Job class functionality and introduces the functionality associated with spawning a &hellip; <a href=\"https:\/\/fip.r-a-w.org\/?p=256\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Refactoring &#8211; Open Closed Principle applied to JobMan<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":237,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-256","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/fip.r-a-w.org\/wp-content\/uploads\/2018\/11\/ANMC0003.jpg?fit=960%2C1200&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9NvWe-48","jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=\/wp\/v2\/posts\/256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=256"}],"version-history":[{"count":7,"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=\/wp\/v2\/posts\/256\/revisions"}],"predecessor-version":[{"id":265,"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=\/wp\/v2\/posts\/256\/revisions\/265"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=\/wp\/v2\/media\/237"}],"wp:attachment":[{"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fip.r-a-w.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}