Session

Client as a Function: The Missing Half of the Story

Server as a Function revolutionised how we think about HTTP server design with http4k. But what about the other side of the equation? This talk introduces the Connect pattern and its Kotlin reference implementation http4k Connect, which brings the same functional simplicity to API client design.

While we carefully compose our server-side APIs from small, focused functions, API clients often remain monolithic classes with dozens of methods. The Connect pattern challenges this asymmetry by modelling API clients as pure functions that accept "actions" - a pattern that mirrors how servers accept requests.

We'll explore how treating clients as functions enables powerful composition patterns, simplifies testing through protocol-compatible fakes, and creates lightweight implementations perfect for Serverless environments. Using http4k Connect as a reference implementation, we'll see these principles in action using Kotlin's powerful type system.

Key takeaways:
- Breaking client monoliths with functional symmetry
- Pattern principles and implementation
- Testing and composition

Although we'll demonstrate these concepts using http4k libraries, the principles behind the Connect pattern apply across all languages and frameworks. Join us to discover how bringing functional thinking to client design can help you write cleaner, more testable HTTP clients, regardless of your technology stack.

David Denton

Engineering Lead // Founder // Trainer // Speaker // Kotlin GDE // Co-creator of http4k

London, United Kingdom

Actions

Please note that Sessionize is not responsible for the accuracy or validity of the data provided by speakers. If you suspect this profile to be fake or spam, please let us know.

Jump to top