{"id":219,"date":"2007-05-31T18:06:06","date_gmt":"2007-05-31T23:06:06","guid":{"rendered":"http:\/\/crschmidt.net\/blog\/?p=219"},"modified":"2007-05-31T18:06:06","modified_gmt":"2007-05-31T23:06:06","slug":"google-developer-day-python-design-patterns","status":"publish","type":"post","link":"https:\/\/crschmidt.net\/blog\/archives\/219\/google-developer-day-python-design-patterns\/","title":{"rendered":"Google Developer Day: Python Design Patterns"},"content":{"rendered":"<p>Some notes from the Python Design Patterns: <\/p>\n<ul>\n<li>Largely talking about Facade vs. Adapters are: Facade is creating simple interfaces around very-rich interfaces to limit you to what the client needs. Adapters are well-suited for small-scale, Facade better when you have a large API you want to hide. \n<\/li>\n<li>favor object composition over class inheritence <\/li>\n<li>If you&#8217;re using holding &#8212; I just have an object, it can be on the wrong axis, or you might want to change the internals. This concern applies to Javascript as well: we run into it all the time in OpenLayers. Should Geometry have a feature? Feature have a Geometry? Both?<\/li>\n<li>Object Wrapping: Law of Demeter: You should only have one dot in your path. Client only talks with wrapper: delegate under to cover.<\/li>\n<li>&#8220;Factory&#8221; is essentially built in in Python<\/li>\n<li>Examples of adapters, talking about two tools which provide same functionality, talking about per-class subclassing, passing instances into wrapper, etc. etc. &#8220;Mixins are the smartest usage of multiple inheritence&#8221;: inherit from two class, and override the method you don&#8217;t want called to call the one you do want called. &#8220;Mix and match.&#8221; This is what OpenLayers uses, I think: Schuyler says that anyway \ud83d\ude09<\/li>\n<\/ul>\n<p>Speaker seems very intelligent, but a bit dull as a speaker: he&#8217;s also probably speaking significantly over my head. \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some notes from the Python Design Patterns: Largely talking about Facade vs. Adapters are: Facade is creating simple interfaces around very-rich interfaces to limit you to what the client needs. Adapters are well-suited for small-scale, Facade better when you have a large API you want to hide. favor object composition over class inheritence If you&#8217;re [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[64],"tags":[],"class_list":["post-219","post","type-post","status-publish","format-standard","hentry","category-gdd07"],"_links":{"self":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/comments?post=219"}],"version-history":[{"count":0,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/posts\/219\/revisions"}],"wp:attachment":[{"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/media?parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/categories?post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/crschmidt.net\/blog\/wp-json\/wp\/v2\/tags?post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}