Skip to content

Repository files navigation

Design Pattern Java Examples

This repository contains Java examples for creational, structural, and behavioral design patterns. Each pattern folder includes a short explanation and a Mermaid diagram showing the main participants or flow.

Review Notes

See PATTERN_REVIEW.md for follow-up notes about examples that could better match the intent of their design pattern.

Patterns

CategoryPatternDoc
CreationalAbstract Factoryabstract-factory.md
CreationalBuilderbuilder.md
CreationalFactory Methodfactory-method.md
CreationalPrototypeprototype.md
CreationalSimple Factory Methodsimple-factory-method.md
CreationalSingletonsingleton.md
StructuralAdapteradapter.md
StructuralBridgebridge.md
StructuralCompositecomposite.md
StructuralDecoratordecorator.md
StructuralFacadefacade.md
StructuralFlyweightflyweight.md
StructuralProxyproxy.md
BehavioralChain of Responsibilitychain-of-responsibility.md
BehavioralCommandcommand.md
BehavioralInterpreterinterpreter.md
BehavioralIteratoriterator.md
BehavioralMediatormediator.md
BehavioralMementomemento.md
BehavioralObserverobserver.md
BehavioralStatestate.md
BehavioralStrategystrategy.md
BehavioralTemplate Methodtemplate-method.md
BehavioralVisitorvisitor.md

Structure

flowchart TB
subgraph Creational
direction TB
C1[Abstract Factory]
C2[Builder]
C3[Factory Method]
C4[Prototype]
C5[Simple Factory Method]
C6[Singleton]
C1 ~~~ C2 ~~~ C3 ~~~ C4 ~~~ C5 ~~~ C6
end
subgraph Structural
direction TB
S1[Adapter]
S2[Bridge]
S3[Composite]
S4[Decorator]
S5[Facade]
S6[Flyweight]
S7[Proxy]
S1 ~~~ S2 ~~~ S3 ~~~ S4 ~~~ S5 ~~~ S6 ~~~ S7
end
subgraph Behavioral
direction TB
B1[Chain of Responsibility]
B2[Command]
B3[Interpreter]
B4[Iterator]
B5[Mediator]
B6[Memento]
B7[Observer]
B8[State]
B9[Strategy]
B10[Template Method]
B11[Visitor]
B1 ~~~ B2 ~~~ B3 ~~~ B4 ~~~ B5 ~~~ B6 ~~~ B7 ~~~ B8 ~~~ B9 ~~~ B10 ~~~ B11
end
Loading

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages