A curated collection of design patterns implementations in Java.
The goal of this repository is to provide clear, simplified examples of the Gang of Four (GoF) design patterns to help developers understand how to solve common architectural problems.
- Introduction
- Directory Structure
- Creational Patterns
- Structural Patterns
- Behavioral Patterns
- How to Run
- Contributing
Design patterns are typical solutions to commonly occurring problems in software design. They are like blueprints that you can customize to solve a particular design problem in your code.
This repository covers the three main categories:
- Creational: Mechanisms for object creation that increase flexibility and reuse.
- Structural: How to assemble objects and classes into larger structures.
- Behavioral: Effective communication and assignment of responsibilities between objects.
The repository is organized by pattern category. Each pattern contains source code, a UML diagram explanation, and a usage example.
root/
βββ π creational/
β βββ singleton/
β βββ factory_method/
β βββ builder/
βββ π structural/
β βββ adapter/
β βββ decorator/
βββ π behavioral/
β βββ observer/
β βββ strategy/
βββ README.md