0% found this document useful (0 votes)
30 views2 pages

Java Design Patterns Cheat Sheet

Uploaded by

mrunalidalal25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Java Design Patterns Cheat Sheet

Uploaded by

mrunalidalal25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Java Design Patterns Cheat Sheet

Creational Patterns
Singleton: getInstance(), private constructor, static instance
Factory Method: create(), getProduct(), Factory, Product
Abstract Factory: FactoryProducer, createFactory(), AbstractFactory
Builder: Builder, build(), setName(), new Builder()
Prototype: clone(), implements Cloneable

Structural Patterns
Adapter: implements Target, adaptee, Adapter
Decorator: wraps, Component, Decorator, super.operation()
Composite: add(Component), remove(Component), Composite, Leaf
Proxy: Proxy, RealSubject, Subject, access control, lazy load
Facade: Facade, simplified interface, subsystems
Bridge: Abstraction, Implementor, extends, composition
Flyweight: FlyweightFactory, shared, intrinsic state

Behavioral Patterns
Observer: Observable, Observer, notify(), update()
Strategy: Strategy, Context, setStrategy()
Command: Command, execute(), Invoker, Receiver
State: State, Context, setState()
Template Method: abstract class, templateMethod(), final, steps()
Iterator: Iterator, hasNext(), next()
Chain of Responsibility: Handler, setNext(), handleRequest()
Mediator: Mediator, Colleague, notify(), send()
Memento: Memento, Originator, Caretaker, saveState()
Visitor: Visitor, visit(), accept()
Interpreter: Expression, interpret(), Context

Modern/Cloud Patterns
Circuit Breaker: Resilience4j, @CircuitBreaker, fallbackMethod
Retry Pattern: @Retryable, @Recover, Spring Retry
Saga Pattern: @Transactional, orchestrator, event sourcing
Event Sourcing: Event, EventStore, apply(event)
CQRS: Command, Query, CommandHandler, QueryHandler
Java Design Patterns Cheat Sheet

API Gateway: Spring Cloud Gateway, route, filter


Backend for Frontend: BFF, controller, custom API per UI
Strangler Fig: Router, legacy API, newService()

You might also like