(This project is used for my blog.)
This project serves as a collection of demonstrations for various software design patterns in Java.
Each pattern is organized as a separate module and is divided into two main subpackages:
-
principle — Contains a minimal, focused implementation that illustrates the core idea of the pattern.
-
example — Contains a more practical or real-world example that applies the pattern in context.
✅ The Memento Pattern
Capture and externalize an object's internal state so that it can be restored later, without violating encapsulation.
✅ The Factory Method Pattern
This approach abstracts away the specifics of which class gets instantiated, encouraging flexible and loosely coupled code that aligns well with the dependency inversion principle.
✅ The Observer pattern
The Observer pattern establishes a one-to-many relationship between objects, A subject (publisher) maintains a list of observers.