~/talk

g ∘ f patterns

Talkat Voxxed Days Zurich 2017 · on Thursday, 2017-02-23· [java]
slides:none on file

Claim: most GoF behavioral patterns are boilerplate workarounds for missing higher‑order functions and Java 8 lambdas remove that boilerplate. Live‑coded examples replace Command with Runnable lists, Template with an execute(resource -> ...) using Consumer and try/finally, Decorator with function composition, Chain of Responsibility with a Stream of functions returning Optional, and an RPN interpreter using a Map<String,BinaryOperator>. Uses Java 8 lambdas, streams, Optional, DoubleUnaryOperator and reduction (identity as monoid); all examples run and produce the same results. replace GoF behavioral patterns with lambdas compose DoubleUnaryOperator via stream reduction

AI-written summary · about

  1. 0:00Functional design patterns intro
  2. 3:34Command pattern functionally
  3. 9:35Strategy pattern with functions
  4. 15:54Template method as function
  5. 21:02Decorator via composition
  6. 27:54Advanced composition with monoid
  7. 31:09Chain of responsibility with optional
  8. 41:34Interpreter in functional style
  9. 48:07Functional interfaces and annotations
  10. 49:54Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.