Recent Posts (java)
A Gentle Introduction to Java 25 Stream Gatherers
- By Ercan
- 01/11/2025
Since Java 8, the Stream API has revolutionized how we process collections and sequences in Java. With map, filter and flatMap, developers gained a declarative, functional approach to transforming data. However, as real-world data processing evolved, the need for stateful intermediate operations, windowed processing, and concurrent mapping became evident. Java 25 addresses these gaps by introducing Gatherers, a new set of tools in the Stream API designed to simplify complex stream workflows. Whether you want to perform sliding window calculations, cumulative scans, or batch processing with ..
Building Scalable gRPC Microservices with Spring Cloud: Eureka vs Consul
- By Ercan
- 28/10/2025
Modern microservices architectures demand scalable, resilient service discovery. In this post, I’ll walk you through a real-world implementation using Spring Boot, Spring Cloud, and gRPC, comparing two popular service registries: Eureka and Consul. Architecture Overview This project is structured as a multi-module Maven application, each module serving a distinct role: config-server: Centralized configuration using Spring Cloud Config. grpc-lib: Contains the gRPC service definition (hello.proto) and generated stubs. grpc-server: Implements the HelloService gRPC service. grpc-..
String Boot Hexagonal Architecture Example
- By Ercan
- 25/10/2025
Architectural concepts like ports, adapters, domain, infrastructure frequently feel abstract when you first read about them. To move from theory to intuition I built a small, multi-module Spring Boot project: a calculator that performs addition, subtraction, multiplication and division, and logs every calculation to a database. The point of this project is not complex business logic — it’s to show how Hexagonal Architecture (aka Ports & Adapters) organizes code so the domain remains framework- and I/O-agnostic, while adapters provide concrete interfaces to the outside world (REST, SOAP,..
Spring Boot Bottom-Up SOAP Service Example
- By Ercan
- 22/10/2025
SOAP services are still widely used in enterprise systems and legacy integrations. However, new Spring Boot developers often struggle with WSDL, XSD, and Jakarta namespaces. In this blog, we will create a bottom-up SOAP service where the WSDL is automatically generated from Java classes and annotations. The project uses jaxws-spring-jakarta, a modernized SOAP runtime compatible with Spring Boot 3. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/soap-producer-bottom-up ..
Spring Boot Command Pattern Example
- By Ercan
- 21/10/2025
The Command Pattern is one of the most versatile and widely used behavioral design patterns. It encapsulates a request as an object, allowing you to parameterize, queue, and execute actions dynamically — all without tightly coupling the caller to the actual logic being executed. In this article, we’ll explore how to apply the Command Pattern in a real-world Spring Boot project, where we execute different text encoding and decoding algorithms such as Caesar, Atbash, and ROT13. This example is designed to be both educational and practical — ideal for developers who want to deeply understan..
Spring Boot Template Method Pattern Example
- By Ercan
- 19/10/2025
Design patterns are timeless tools that bring structure and clarity to software projects. In this post, we’ll explore how to use the Template Method Pattern within a Spring Boot application — through a simple but practical example: an Email Builder API. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/template-method-pattern What Is the Template Method Pattern? The Template Method Pattern defines the skeleton of an algorithm in a base (abstract) class and allows subclasses to redef..
Spring Boot Iterator Pattern Example
- By Ercan
- 28/09/2025
When working with multiple processing strategies—such as hashing algorithms—it is common to loop through a collection and apply each one. However, directly exposing the collection and iterating outside the component can make the code fragile and tightly coupled. This is where the Iterator Pattern comes into play. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/iterator-pattern The Use Case: Hashing Text with Multiple Algorithms Our Spring Boot application takes a text input and re..
Spring Boot Chain of Responsibility Pattern Example
- By Ercan
- 26/09/2025
The Chain of Responsibility is a behavioral design pattern that allows us to process a request through a sequence of handlers. Each handler decides whether it can process the request or pass it along to the next handler in the chain. In this article, we will demonstrate how this pattern can be applied in a Spring Boot application to resolve which hashing algorithm was used for a given hash. TL;DR: If you want to skip the explanation and dive straight into the code, check out the full implementation on GitHub: https://github.com/ercansormaz/chain-of-responsibility-pattern Problem to ..
Spring Boot Strategy Pattern Example
- By Ercan
- 25/09/2025
Design patterns are one of the most valuable tools in a developer’s toolkit. They provide proven solutions to recurring design problems and help us write code that is maintainable, flexible, and easy to extend. One of the most practical patterns in everyday software development is the Strategy Pattern. In this article, we’ll look at how the Strategy Pattern can be applied in a real-world example using Spring Boot. We will build a simple REST API that takes a piece of text and returns its hash, depending on the algorithm selected by the client. The project is a minimal but effective demonstr..
