Skip to content

Instantly share code, notes, and snippets.

View Encapsulation.py
# 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 Mar 28, 2020
profiles.clj
View 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)]}}
View app.clj
(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")