Skip to main content

21 docs tagged with "pattern"

View all tags

Abstract Factory Pattern

A creational pattern that produces families of related objects without specifying their concrete classes.

Adapter Pattern

A structural pattern that allows incompatible interfaces to work together by wrapping one interface with a compatible one.

Builder Pattern

A creational pattern that separates the construction of a complex object from its representation, allowing the same construction process to produce different results.

Caching Strategies

Patterns for caching application data — cache-aside, write-through, write-behind — eviction policies, TTL design, and cache stampede prevention in Spring Boot with Redis.

Chain of Responsibility Pattern

A behavioral pattern that passes a request along a chain of handlers, each deciding to process it or pass it to the next handler.

Command Pattern

A behavioral pattern that encapsulates a request as an object, enabling undo/redo, queuing, logging, and parameterization of operations.

Composite Pattern

A structural pattern that composes objects into tree structures to represent part-whole hierarchies, letting clients treat individual objects and compositions uniformly.

Decorator Pattern

A structural pattern that dynamically adds behavior to an object by wrapping it in decorator objects, without altering the original class.

Exception Handling in Spring MVC

How to centralise HTTP error responses in Spring Boot — @ExceptionHandler, @ControllerAdvice, ProblemDetail (RFC 7807), and mapping domain exceptions to the right status codes.

Facade Pattern

A structural pattern that provides a simplified interface to a complex subsystem, hiding its internal complexity from client code.

Factory Method Pattern

A creational pattern that defines an interface for creating an object but lets subclasses decide which class to instantiate.

Observer Pattern

A behavioral pattern where an object (subject) maintains a list of dependents (observers) and notifies them automatically when its state changes.

Prototype Pattern

A creational pattern that creates new objects by copying (cloning) an existing instance rather than instantiating from scratch.

Proxy Pattern

A structural pattern that provides a surrogate object which controls access to another object, adding security, caching, logging, or lazy initialization transparently.

Reliability Patterns

Circuit Breaker, Retry, Bulkhead, Timeout, and Rate Limiter — the five resilience patterns that prevent cascading failures in distributed Spring Boot services, implemented with Resilience4j.

Scalability Patterns

Horizontal vs vertical scaling, stateless services, read replicas, database sharding, and load balancing — the patterns that allow a Java/Spring Boot system to handle growing traffic.

Singleton Pattern

A creational pattern that ensures a class has exactly one instance and provides a global access point to it.

State Pattern

A behavioral pattern that allows an object to change its behavior when its internal state changes, as if the object changed its class.

Strategy Pattern

A behavioral pattern that defines a family of algorithms, encapsulates each one, and makes them interchangeable at runtime without changing the client.

Template Method Pattern

A behavioral pattern that defines the skeleton of an algorithm in a base class, deferring specific steps to subclasses without changing the overall structure.

Thread Safety Patterns

Three design-level strategies for writing correct concurrent code — immutability, ThreadLocal confinement, and explicit object confinement — without reaching for locks.