Pārlūkot izejas kodu

added diagram and updates

Harlan Iverson 9 gadi atpakaļ
vecāks
revīzija
c7247fca42
2 mainītis faili ar 42 papildinājumiem un 0 dzēšanām
  1. 42 0
      README.md
  2. BIN
      doc/clojure-everywhere.jpg

+ 42 - 0
README.md

@@ -24,6 +24,9 @@ A baseline Clojure stack that runs on any and all platforms, that is nice to dev
 * No bullshit (pull request if you disagree)
 
 
+![Architecture Sketch](doc/clojure-everywhere.jpg)
+
+
 ## Philosophy
 
 Much influence has been drawn from Continuous Delivery, The Reactive Manifesto, and the Lean Startup. Talks such as 
@@ -342,6 +345,26 @@ to use an in-memory map based dispatch (ie. constant lookup time).
 ```
 
 
+#### Prismatic Schema
+
+Progressive typing support; prismatic gives alternative `defn`, `defrecord`, etc which allow creating types via
+a simple DSL:
+
+```
+(def MyEvent
+  "A schema for a nested data type"
+  {:a {:b s/Str
+       :c s/Int}
+   :d [{:e s/Keyword
+        :f [s/Num]}]})
+
+(defmulti react [component event :- MyEvent] :component/event)
+```
+
+The `:-` operator works in much the same way as the same way as the `^` operator but is more rich (see doc for more
+info).
+
+
 ### Marathon deployment
 
 12 Factor App
@@ -514,6 +537,25 @@ you think in terms of the capabilities of a system. Component helps us manage th
 ```
 
 
+### Extensible component component
+
+```clojure
+(defmulti react [component event] :component/event)
+
+(defmethod react :component/extend [component event]
+  (let [component-ns (resolve (:ns event))
+        new-method (:react event)]
+    (binding [*ns* component-ns]
+      (eval new-method))))
+
+(defmethod react :component/extend [component event]
+  (let [component-ns (find-ns (:ns event))
+        new-method (:react event)]
+    (binding [*ns* component-ns]
+      (eval new-method))))
+```
+
+
 
 Idea:
 

BIN
doc/clojure-everywhere.jpg