Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a sustainable architecture

Building a sustainable architecture

Marcelo Piva

October 26, 2019
Tweet

More Decks by Marcelo Piva

Other Decks in Programming

Transcript

  1. Class Object Instance Inheritance Polymorphism Abstract Factory Builder Factory Method

    Object Pool Prototype Singleton Adapter Bridge Composite Decorator Facade Flyweight Private Class Data Proxy Chain of responsibility Command Interpreter Iterator Mediator Memento Null Object Observer State
  2. why not imperative? (defn block! [card datomic producer] (when (logic.card/can-block?

    card) (let [locked-card (logic.card/block card)] (datomic.card/update! blocked-card datomic) (producer.card/status-changed! blocked-card producer))))
  3. why not imperative? (defn block-all! [customer cards datomic producer] (doseq

    [card cards] (block! card datomic producer)) (cards-blocked-notify! customer producer))
  4. why not imperative? (defn block-all! [customer cards datomic producer] (doseq

    [card cards] (block! card datomic producer)) (cards-blocked-notify! customer producer))
  5. why not imperative? (defn block-all! [customer cards datomic producer] (doseq

    [card cards] (block! card datomic producer)) (cards-blocked-notify! customer producer))
  6. (defn block [card] (if (logic.card/can-block? card) (let [blocked-card (logic.card/block card)]

    (-> e/empty-effects (effect.card/update blocked-card) (effect.card/status-changed blocked-card)))) e/empty-effects))