CPPB pattern macros: Collect → Promote → Pipeline → Boundary.
Codifies an L3 stratified architecture for data-enrichment workflows. Reuses hive-dsl Result monad for railway-oriented threading.
Roles (carried as :cppb/role var metadata):
:collector — gather raw data from a source. Pure-or-leaf. Returns Result. :promoter — pure data → enriched data. Returns Result. :pipeline — pure orchestration: run collectors, thread through promoters. :boundary — effectful edge: dispatch on Result, fire side effect.
Invariants enforced by convention (not compiler):
CPPB pattern macros: Collect → Promote → Pipeline → Boundary. Codifies an L3 stratified architecture for data-enrichment workflows. Reuses hive-dsl Result monad for railway-oriented threading. Roles (carried as :cppb/role var metadata): :collector — gather raw data from a source. Pure-or-leaf. Returns Result. :promoter — pure data → enriched data. Returns Result. :pipeline — pure orchestration: run collectors, thread through promoters. :boundary — effectful edge: dispatch on Result, fire side effect. Invariants enforced by convention (not compiler): 1. Collectors independent — none depends on another's output 2. Promoters composable — order may vary; data → enriched data 3. Pipeline = pure orchestration, no effects 4. Boundary thin — one fn, Result → response or side effect 5. Data flows DOWN; effects only at boundary
Reusable property-based test scaffolding for CPPB roles.
These helpers consume the :cppb/role metadata stamped onto vars by
defcollector / defpromoter / defpipeline / defboundary (see
hive-cppb.core) and produce clojure.test assertions that
exercise the canonical laws each role is expected to obey.
Helpers are designed to be called from a caller's own test ns:
(require '[hive-cppb.test :as cppb-test]) (require '[clojure.test.check.generators :as gen])
(deftest add-totals-laws (cppb-test/promoter-laws #'add-totals (gen/hash-map :fetch-numbers (gen/vector gen/small-integer))))
Each helper is a regular function that runs clojure.test/is assertions
inline, so it can be dropped into any deftest. They throw via the
underlying assertion machinery if a law is violated.
Laws codify the CPPB principle: pure data flow with effects pushed to the boundary.
Reusable property-based test scaffolding for CPPB roles.
These helpers consume the `:cppb/role` metadata stamped onto vars by
`defcollector` / `defpromoter` / `defpipeline` / `defboundary` (see
`hive-cppb.core`) and produce `clojure.test` assertions that
exercise the canonical laws each role is expected to obey.
Helpers are designed to be called from a caller's own test ns:
(require '[hive-cppb.test :as cppb-test])
(require '[clojure.test.check.generators :as gen])
(deftest add-totals-laws
(cppb-test/promoter-laws #'add-totals
(gen/hash-map :fetch-numbers (gen/vector gen/small-integer))))
Each helper is a regular function that runs `clojure.test/is` assertions
inline, so it can be dropped into any `deftest`. They throw via the
underlying assertion machinery if a law is violated.
Laws codify the CPPB principle: pure data flow with effects pushed to
the boundary.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |