{"id":37835,"date":"2016-10-20T14:03:00","date_gmt":"2016-10-20T19:03:00","guid":{"rendered":"http:\/\/kenscourses.com\/tc1019fall2016\/?guid=86aaf2b62fae8998f0771180b135cb16"},"modified":"2016-10-20T14:03:32","modified_gmt":"2016-10-20T19:03:32","slug":"patterns-software-patterns-everywhere","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc1019fall2016\/syndicated\/patterns-software-patterns-everywhere\/","title":{"rendered":"Patterns. Software patterns everywhere\u2026"},"content":{"rendered":"<div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"font-family: Arial; font-size: 14.6667px; white-space: pre-wrap;\">Ummm what?<\/span><\/div><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">I didn\u2019t know what these were, either. After some research, I\u2019ll now try explaining to you what I learned. Sounds good to you?<\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Again, this has a very continuous relationship with previous topics I\u2019ve talked about before. Specially, you\u2019ll find yourself thinking of software architecture (hopefully). Why? For starters, design patterns are something a software architect should always be able to identify. Let me too you why\u2026<\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">There are some reusable, optimized solutions to common programming problems. Solutions that people who build programming languages should also identify right away. This solutions I\u2019m talking about are, in fact, design patterns. But all these people must be careful: \u201cIf implemented in the wrong place, it can be disastrous and create many problems for you. However, implemented in the right place, at the right time, it can be your savior\u201d. (<\/span><a href=\"https:\/\/code.tutsplus.com\/articles\/a-beginners-guide-to-design-patterns--net-12752\" style=\"text-decoration: none;\"><span style=\"background-color: transparent; color: #1155cc; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;\">source<\/span><\/a><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">)<\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">It\u2019s important to know there are basically 3 types of design patterns:<\/span><\/div><ul style=\"margin-bottom: 0pt; margin-top: 0pt;\"><li dir=\"ltr\" style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;\"><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Structural<\/span><\/div><\/li><li dir=\"ltr\" style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;\"><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Creational<\/span><\/div><\/li><li dir=\"ltr\" style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; list-style-type: disc; text-decoration: none; vertical-align: baseline;\"><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Behavioral<\/span><\/div><\/li><\/ul><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Their names don\u2019t say much, do they?<\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Structural<\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"> patterns refer to relationships, how entities work together.<\/span><\/div><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Creational<\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"> patterns refer to the way mechanisms are instantiated, so each situation has its easiest way of object-creation.<\/span><\/div><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Behavioral<\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"> patterns refer to the communication between entities (please do not confuse these with structural patterns).<\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">What I mean by \u201cpatterns\u201d is basically past situations other programmers have been through. They\u2019ve experienced the same, and now they know a solution for it. Why wouldn\u2019t you want to consider their way of solving these problems?<\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Let me include a very illustrative result:<\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><img height=\"197\" src=\"https:\/\/lh3.googleusercontent.com\/RKE80qIrEtlLwWe5DH47i0IRp79OyX6vctF2DcwDSlq0eTyVZOxf2c-YoGS-CiTCStpoOd-AFu9JwoS83CW4vQyEu2sxjLm1PahIhBj6tXDBCAFUk_2EbvHu1DCClzQtVXSMfedW\" style=\"-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);\" width=\"408\" \/><\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">Imagine something like this in code-form. How many interfaces do you see? several. <\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><br class=\"kix-line-break\" \/><\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">But on the other side, in how many ways is this thing reacting to the several interfaces? One. Just one! This is precisely <\/span><a href=\"https:\/\/code.tutsplus.com\/articles\/a-beginners-guide-to-design-patterns--net-12752\" style=\"text-decoration: none;\"><span style=\"background-color: transparent; color: #1155cc; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;\">one example<\/span><\/a><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"> of the <\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 700; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;\">adapter pattern<\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">: \u201cstructural design pattern that allows <div class=\"post-limited-image\"><img height=\"236\" src=\"https:\/\/lh5.googleusercontent.com\/Kt7xpJqAWOQOewsvstRqNwhb5LwgksYaXREJZ_Ke3EWsyg21riX0h0UPfDWN0R8LA3B6d-VxKmTrd-sC5WJAA-1oICSME7yFkKU-CgFTbHzeLlG7yFw6JUSYyfO8kVupCL6QZsj9\" style=\"-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);\" width=\"236\" \/><\/div><!--more--> to repurpose a class with a different interface, allowing it to be used by a system which uses different calling methods\u201d. How COOL is that?<\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><br class=\"kix-line-break\" \/><\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><br class=\"kix-line-break\" \/><\/span><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">This one and some other examples can be found here: <\/span><a href=\"https:\/\/code.tutsplus.com\/articles\/a-beginners-guide-to-design-patterns--net-12752\" style=\"text-decoration: none;\"><span style=\"background-color: transparent; color: #1155cc; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;\">https:\/\/code.tutsplus.com\/articles\/a-beginners-guide-to-design-patterns--net-12752<\/span><\/a><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">One last thing before you go: ALWAYS make sure the solution you\u2019re working with is actually meant for particular problems like your own. Hopefully you won\u2019t ever find yourself in a situation where you learn this the hard way. <\/span><\/div><b style=\"font-weight: normal;\"><br \/><\/b><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 14.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\"><img height=\"236\" src=\"https:\/\/lh5.googleusercontent.com\/Kt7xpJqAWOQOewsvstRqNwhb5LwgksYaXREJZ_Ke3EWsyg21riX0h0UPfDWN0R8LA3B6d-VxKmTrd-sC5WJAA-1oICSME7yFkKU-CgFTbHzeLlG7yFw6JUSYyfO8kVupCL6QZsj9\" style=\"-webkit-transform: rotate(0.00rad); border: none; transform: rotate(0.00rad);\" width=\"236\" \/><\/span><\/div><div dir=\"ltr\" style=\"line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;\"><span style=\"background-color: transparent; color: black; font-family: Arial; font-size: 10.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;\">image retrieved from <\/span><a href=\"https:\/\/es.pinterest.com\/pin\/468022586247613253\/\" style=\"text-decoration: none;\"><span style=\"background-color: transparent; color: #1155cc; font-family: Arial; font-size: 10.666666666666666px; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: underline; vertical-align: baseline; white-space: pre-wrap;\">https:\/\/es.pinterest.com\/pin\/468022586247613253\/<\/span><\/a><\/div><br \/>","protected":false},"excerpt":{"rendered":"<p>Ummm what?I didn\u2019t know what these were, either. After some research, I\u2019ll now try explaining to you what I learned. Sounds good to you?Again, this has a very continuous relationship with previous topics I\u2019ve talked about before. Specially, you\u2019ll find yourself thinking of software architecture (hopefully). Why? For starters, design patterns are something a software &hellip; <a href=\"https:\/\/kenscourses.com\/tc1019fall2016\/syndicated\/patterns-software-patterns-everywhere\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Patterns. Software patterns everywhere\u2026<\/span><\/a><\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[],"class_list":["post-37835","post","type-post","status-publish","format-standard","hentry","category-blogs","category-syndicated"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/posts\/37835","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/comments?post=37835"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/posts\/37835\/revisions"}],"predecessor-version":[{"id":37836,"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/posts\/37835\/revisions\/37836"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/media?parent=37835"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/categories?post=37835"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc1019fall2016\/wp-json\/wp\/v2\/tags?post=37835"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}