https://github.com/khaledsawan/design-patterns
The Singleton, Factory Method, Adapter, Composite, and Observer design patterns are all demonstrated together.
https://github.com/khaledsawan/design-patterns
adapter-pattern composite-pattern design-patterns factory-method-pattern java observer-pattern singleton-pattern
Last synced: 4 months ago
JSON representation
The Singleton, Factory Method, Adapter, Composite, and Observer design patterns are all demonstrated together.
- Host: GitHub
- URL: https://github.com/khaledsawan/design-patterns
- Owner: khaledsawan
- Created: 2023-09-06T22:46:51.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-06T22:54:18.000Z (almost 2 years ago)
- Last Synced: 2025-01-09T21:53:04.674Z (6 months ago)
- Topics: adapter-pattern, composite-pattern, design-patterns, factory-method-pattern, java, observer-pattern, singleton-pattern
- Language: Java
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# design-patterns
## The Singleton, Factory Method, Adapter, Composite, and Observer design patterns are all demonstrated together.- **Singleton** ensures that there is only one instance of the Singleton class.
- **Factory Method** is used to create objects based on a common interface.
- **Adapter** allows the `AdapterLegacySystem` to adapt the legacy system's interface to the Product interface.
- **Composite** represents a part-whole hierarchy with Component, Leaf, and Composite classes.
- **Observer** defines a one-to-many relationship between the Subject and multiple Observer objects.
This example showcases the integration of these design patterns into a single application, illustrating how they can work together in a cohesive manner.