These are basic examples of all the GOF 23 Design Patterns implemented in Java.
This project incorporates various design patterns from the famous Gang of Four design patterns. These design patterns provide proven solutions to recurring design problems, enhancing flexibility, maintainability, and scalability of the system.
These patterns focus on object creation mechanisms, aiming to create objects in a manner suitable to the situation. They hide the specifics of object creation, making the system more flexible and independent of the system's evolution. The creational patterns included in this project are:
- Singleton
- Factory Method
- Abstract Factory
- Builder
- Prototype
Structural patterns deal with object composition, creating relationships between objects to form larger structures. They help in building flexible and efficient systems by defining clear ways to compose objects. The structural patterns included in this project are:
- Adapter
- Bridge
- Composite
- Decorator
- Facade
- Flyweight
- Proxy
Behavioral patterns focus on communication between objects, managing the algorithms and responsibilities between cooperating objects. They help define clear and efficient communication mechanisms between objects. The behavioral patterns included in this project are:
- Chain of Responsibility
- Command
- Interpreter
- Iterator
- Mediator
- Memento
- Observer
- State
- Strategy
- Template Method
- Visitor
Each pattern is implemented in its respective module. To incorporate a specific pattern into your project, follow these steps:
-
Navigate to the Desired Pattern Module:
- Go to the directory corresponding to the design pattern you want to use.
-
Copy the Relevant Files:
- Copy the necessary files (classes, interfaces, etc.) related to the pattern into your project.
-
Integrate the Pattern:
- Implement the pattern in your codebase by utilizing the classes and interfaces from the copied files.
-
Modify as Needed:
- Tailor the implementation to suit the specific requirements of your project.
For examples and usage guidelines specific to each design pattern, please refer to the respective module's documentation.
This project is licensed under the MIT License.
Special thanks to the Gang of Four for their pioneering work in design patterns, as well as to the authors of the following resources: