This repository contains educational code examples for various design patterns implemented in Java. It is designed to help learners understand and apply design patterns in their projects. Each file and folder includes detailed comments to explain the code and concepts.
The repository covers the following design patterns:
- Abstract Factory
- Adapter
- Command
- Composite
- Decorator
- Facade
- Factory
- Iterator
- Observer
- Singleton
- State
- Strategy
- Template
Additionally, the repository includes exercise code for the following patterns:
- Command & Observer Pattern
- Decorator Pattern
- Factory Pattern
- Observer Pattern
- Strategy Pattern
Each Java file and folder is named to indicate the design pattern it covers. For example, the 1-abstract_factory_pattern
folder contains Main.java
, which demonstrates various techniques related to the abstract factory pattern.
For instance, in the 5-decorator_design_pattern
folder, you will find Main.java
that illustrates the decorator pattern in detail, with comments explaining each part of the code.
If you'd like to contribute to this repository, feel free to submit a pull request. You can add new examples, improve existing code, or fix any issues. Contributions of all levels are welcome!
This repository is licensed under the MIT License. See the LICENSE file for more information.
Note: This repository is intended for educational purposes to help learn and understand Java design patterns.
Remember to star the repository if you find it useful!