The Builder Macro
Some astute readers of the previous post on builder pattern highlighted the verbosity of the pattern. The builder pattern is a powerful pattern but comes with the baggage of boilerplate code. One even …
Read more →
Some astute readers of the previous post on builder pattern highlighted the verbosity of the pattern. The builder pattern is a powerful pattern but comes with the baggage of boilerplate code. One even …
Read more →
This is a post-credits bonus post that shows the complete and finished builder code.
Read more →
While the builder pattern is a powerful tool for creating complex objects in a type-safe manner, it is easy to discard it given its complexity and boilerplate. This post details the situations where …
Read more →
This post takes the ideas from previous posts to get rid of some boilerplate, and concluding the “how” portion of the series.
Read more →
This post adds type-level ordering to the builder, enforcing when fields can be set. It introduces explicit constraints on configuration order: host/port first, maxConnections/connectionTimeout before …
Read more →
This post makes the builder API more flexible by allowing incremental health check additions without losing type safety. We will see how withHealthChecks is changed from replace to append, so calls …
Read more →
This post talks about making the error messages cleaner and clearer. You might want to read this one since it involves typeclasses. 😉
Read more →
This post extends a prior typesafe Builder Pattern and demonstrates where it breaks down with a more complex AppConfig[F[_]] that wires Auth, Users, Books, and multiple HealthChecks. It presents a …
Read more →
The Builder pattern provides a way to construct complex objects step by step with a fluent API, where each method call returns the builder itself, allowing for method chaining. Let us play some type …
Read more →