Welcome to the Design Patterns repository — a complete collection of all major design patterns explained with simple and clean Java code.
This repo is perfect for students, developers, and interviewees who want to understand, revise, or implement design patterns in real life.
The patterns are categorized as per the Gang of Four (GoF) classification:
- Singleton
- Builder
- Factory Method
- Abstract Factory
- Prototype
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
- Observer
- Command
- Chain of Responsibility
- Memento
- Iterator
- State
- Strategy
- Template Method
- Mediator
- Interpreter
- Visitor
- ✅ A clear explanation
- ✅ Use Case of each pattern
- ✅ Real-world relatable examples (where applicable)
- ✅ Simple Java code
- ✅ Easy to run
.javafiles
-
Clone the repo:
git clone https://github.com/FabihaPritha/Design_Pattern.git
-
Open in any IDE (IntelliJ IDEA, Eclipse, VS Code)
-
Navigate to any pattern folder and run the .java files to understand how it works.
To help developers learn and revise design patterns quickly, without digging through complex code.
PRs (Pull Requests) are welcome! Feel free to fork and enhance the code, fix issues, or add more real-world examples.
⭐ If you found this helpful, don't forget to star the repo and share it with your friends!