Recent Posts (iterator pattern)


Spring Boot Iterator Pattern Example

  • By Ercan
  • 28/09/2025
  • 0 comments

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. The Use Case: Hashing Text with Multiple Algorithms Our Spring Boot application takes a text input and returns the result of hashing that input with multiple algorithms: MD5 SHA-1 SHA-224 SHA-256 SHA-384 SHA-512 Example Request: curl --location 'http:..

Spring Boot Chain of Responsibility Pattern Example

  • By Ercan
  • 26/09/2025
  • 0 comments

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. Problem to Solve Given a plain text string and its hashed value, we want to determine which algorithm (MD5, SHA1, SHA256, etc.) generated the hash. The API Our project provides a simple A..

Spring Boot Strategy Pattern Example

  • By Ercan
  • 25/09/2025
  • 0 comments

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..

Showing 1 to 3 of 3 (1 Pages)