Overview
Syllabus
- Intro & the question from Spring Office Hours
- Why RestClient over RestTemplate
- Setting up the project on start.spring.io
- Using RestClient.create with a static factory method
- Making an HTTP GET call to JSON Placeholder
- The Builder Pattern in Java — why it exists
- Java Beans approach mutable, verbose
- Telescoping constructors approach
- Builder Pattern with immutable fields
- Applying the Builder Pattern to RestClient.Builder
- Spring auto-configures DefaultRestClientBuilder
- Why inject Builder instead of calling create
- Observability, metrics, and customizers
- When you might want manual control
- Wrap up & recommendations
Taught by
Dan Vega