Action and Reaction
Nov. 16th, 2021 09:09 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
Book Review: Hacking with Spring Boot 2.3 - Reactive Edition, by Greg L Turnquist
I've been working with the Spring Webflux reactive stack for 18 months or so now, and whilst it does make more sense, I still feel it has a very steep learning curve without enough learning materials. Having seen a presentation by Josh Long, I didn't feel confident his book would help with real-world scenarios, and a colleague who has a copy gave it only a lukewarm endorsement; I came across this one and despite the somewhat off-putting title, decided to give it a go.
It's not a bad book, and I did learn some things along the way, but I think it may suffer from the author writing two books in parallel (there's a similar title for the "Classic Edition", which presumably deals with the conventional web stack). To be fair, the book is about Spring Boot; quite how much of the Spring ecosystem should be drawn into scope is debatable. Turnquist reaches into Spring Data, Spring Boot Actuator, and Spring Boot Security, which is a good start. Despite being one of the contributors for Spring HATEOAS, he unfortunately alights on some of the limitations and disadvantages of this format in a chapter on RESTful APIs, offering rather quirky workarounds. But on the specific reactive stack, which is the differentiating part I was most interested in, there are somewhat slim pickings. The basic idea behind reactive programming is outlined, along with the base APIs, but it rarely goes anywhere beyond superficial. There is no good explanation for the difference between
The code examples, sadly, are all too reminiscent of real-world code, often difficult to read. Through my career we have progressed from DLL hell through Classpath hell and now into Lambda hell. If I have to fight with counting parentheses and indentations when reading, then it's poorly-written rather than idiomatic code IMO. On the other hand, the sections on testing were more useful, with reasonable efforts around
I've been working with the Spring Webflux reactive stack for 18 months or so now, and whilst it does make more sense, I still feel it has a very steep learning curve without enough learning materials. Having seen a presentation by Josh Long, I didn't feel confident his book would help with real-world scenarios, and a colleague who has a copy gave it only a lukewarm endorsement; I came across this one and despite the somewhat off-putting title, decided to give it a go.
It's not a bad book, and I did learn some things along the way, but I think it may suffer from the author writing two books in parallel (there's a similar title for the "Classic Edition", which presumably deals with the conventional web stack). To be fair, the book is about Spring Boot; quite how much of the Spring ecosystem should be drawn into scope is debatable. Turnquist reaches into Spring Data, Spring Boot Actuator, and Spring Boot Security, which is a good start. Despite being one of the contributors for Spring HATEOAS, he unfortunately alights on some of the limitations and disadvantages of this format in a chapter on RESTful APIs, offering rather quirky workarounds. But on the specific reactive stack, which is the differentiating part I was most interested in, there are somewhat slim pickings. The basic idea behind reactive programming is outlined, along with the base APIs, but it rarely goes anywhere beyond superficial. There is no good explanation for the difference between
map
and flatMap
, with little more than advice to try the latter if the former doesn't work. Yet this is a fairly fundamental point, about which I am hesitant, and still little the wiser. It is something to do with the Reactor framework kicking off another subscription, I think, but it is not well explained (and had I found good explanations on the web I wouldn't have bought this book). R2DBC is mentioned but avoided as not yet mature at the time of writing (publication was May 2020), with little suggestion for how to face the almost inevitable real-world problem of melding reactive and non-reactive code.The code examples, sadly, are all too reminiscent of real-world code, often difficult to read. Through my career we have progressed from DLL hell through Classpath hell and now into Lambda hell. If I have to fight with counting parentheses and indentations when reading, then it's poorly-written rather than idiomatic code IMO. On the other hand, the sections on testing were more useful, with reasonable efforts around
StepVerifier
and a useful introduction to BlockHound. On the whole this book is probably a reasonable short introduction to Spring Boot, but someone already familiar with it will have less to gain.