-
Continue reading →: Clean Code in Java, Teil 2
Reification: Konzepte explizit im Code modellieren Primitive Typen transportieren keine Domänen-Semantik. Ein record Money macht Währung, Betrag und Validierungslogik zu einem eigenständigen Konzept. Lesbarkeit: Money kommuniziert sofort die Domäne. Methodensignaturen erzählen die Geschäftssprache. Wartbarkeit: Validierung lebt im Objekt, nicht verstreut im Aufruf-Code. Eine Änderung wirkt überall. Erweiterbarkeit: Methoden wie add(),…
-
Continue reading →: Clean Code in Java, Teil 1
Clean Code bedeutet leicht lesbaren, wartbaren und veränderbaren Code. Es geht nicht um Perfektion, sondern um Klarheit der Absicht: Jede Klasse, Methode und Variable soll kommunizieren, was sie tut – ohne Kommentar, ohne Nachdenken. Es führt dazu, dass man den Code einfacher testen kann, und mit guter Testabdeckung können wir…
-
Continue reading →: Spring Boot Auto-Configuration Part 2
In the previous post, i started explaining Auto-Configuration in Spring Boot. Her the second part. Other Auto‑Configured Aspects in Spring Boot Spring Boot also auto-configures many other modules. Same idea: add dependency → Spring Boot configures it. 1. Spring Security Add: spring-boot-starter-security Spring Boot will: Default behavior: Minimal example: @RestController…
-
Continue reading →: Spring Boot Auto-Configuration Part 1
Spring Boot helps you build Java applications fast. It removes a lot of manual setup. You write less configuration and more business logic. What is Auto-Configuration? Auto-configuration means: Spring Boot automatically configures your app based on what it finds in your project. It checks: Then it decides what to create…
-
Continue reading →: Reactive Rest Client mit Spring WebFlux einfach erklärt
Ein Reactive REST Client in Spring WebFlux ist ein HTTP-Client, der nicht blockierend arbeitet. Das bedeutet: In Spring Boot WebFlux verwendet man meistens: RestTemplate = klassisch/blockierendWebClient = reactive/non-blocking Grundkonzept einfach erklärt Klassisch/blockierend String result = restTemplate.getForObject(url, String.class); Der Thread wartet hier: Bei vielen Requests braucht man viele Threads. Reactive/non-blocking Mono<String>…
-
Continue reading →: Spring Boot, OAuth2 and OpenID Connect
These two are often confused, OIDC is built on top of OAuth2. The purpose of OAuth2 ist authorization and the question: can this app access data on my behaf? OpenID Connect takes care of identity in addition and answers the question: who is the logged-in user? Think of OAuth2 as…
-
Continue reading →: Property Injection in Spring Boot
Configuration management is one of the most important topics for maintainable applications. In real projects, values can come from many places: In this post I will show: 1. Basic application.yml Spring Boot commonly uses YAML for configuration. 2. Inject Values with @Value The simplest way is using @Value. 3. Using…
-
Continue reading →: Asynchronous Call In Spring Boot / Java
Spring Boot: one common way to run async logic is @Async. Also the main Application class should be annotated with @EnableAsync. Spring Boot: one common way to run async logic is @Async. But there is an important detail: Calling an @Async method from the SAME class will NOT start a…
-
Continue reading →: Selbstliebe
lassen Sie mich mit einer einfachen Frage beginnen: Wann sind Sie sich das letzte Mal selbst mit echter Freundlichkeit begegnet? Nicht mit Leistung.Nicht mit Kritik.Sondern einfach mit Freundlichkeit. Heute möchte ich über zwei Dinge sprechen, die eng zusammengehören: Selbstliebe und selbstbild Wenn ich an meine Vergangenheit denke, sehe ich jemanden…
-
Continue reading →: Blocking and Reactive Rest Clients in Spring Boot/Java
In this post, I would like to explain three ways of implementing a rest client in Spring boot / Java. Using WebFlux Webclient, native RestTemplate and Apache Client. The simplest way is the native RestTemplate provided by the Spring Framework. It is blocking, and for each request, the connection is…
