Spring Cache
A product catalog service queries the database for the same 500 products on every page load. The query takes 200ms and runs thousands of times per hour. Spring Cache lets you store the result in me...
A product catalog service queries the database for the same 500 products on every page load. The query takes 200ms and runs thousands of times per hour. Spring Cache lets you store the result in me...
Business objects often need to react when something else changes. A newsletter publishes new articles and multiple mail clients need to know about it. An order changes status and the inventory, bil...
Imagine you inject the same bean into two controllers. Do they share state? If one request modifies a field on the bean, does the next request see that change? The answer depends entirely on the be...
Tests that read like domain statements catch bugs faster and survive refactoring better than tests full of low-level field checks. Custom assertions with AssertJ let you write assertions that speak...
Imagine a checkout service that needs to support credit cards, PayPal, and bank transfers. The first instinct is usually a chain of if/else blocks: public class CheckoutService { public void ...
SOLID is an acronym for five object-oriented design principles introduced by Robert C. Martin (Uncle Bob). Together they guide developers toward code that is easier to understand, extend, and maint...
Today no one doubts that tests are essential and are first-class citizens of our repositories. I hope so at least. But even though most teams write tests, it is worth stepping back and understandin...