Skip to content

Instantly share code, notes, and snippets.

@grierson
grierson / Encapsulation.py
Last active February 19, 2019 12:09
Problems
# If objects share object then it breaks Encapsulation
# A -> C
# B -> C
# A and B are sharing C state, breaking the encapsulation of parent Objects (A, B).
# Marionettes problem - https://youtu.be/VSdnJDO-xdg?t=1953
class Animal:
def __init__(self, name):
self.name = name
@grierson
grierson / profiles.clj
Last active March 28, 2020 15:19
profiles.clj
{:user {:plugins [[lein-ancient "0.6.15"]
[lein-midje "3.2.1"]
[lein-try "0.4.3"]]
:dependencies [[hashp "0.1.1"]
[vvvvalvalval/scope-capture "0.3.2"]]
:injections [(require 'sc.api)
(require 'hashp.core)]}}
@grierson
grierson / app.clj
Last active February 1, 2019 14:08
(ns dorsia.core
(:require [ring.adapter.jetty :as jetty]
[ring.util.response :as resp]
[integrant.core :as ig]
[reitit.ring :as ring]))
;; Start Persistence
(defprotocol ReservationRepository
(create [this reservation] "Add reservation")