This repository contains Java implementations of various design patterns discussed in the "Head First Design Patterns" book. Currently, implementations for the Strategy and Observer patterns are available. More patterns will be added gradually.
-
Strategy Pattern:
- The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. It lets the algorithm vary independently from clients that use it.
- Click here to view the implementation
-
Observer Pattern:
- The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
- Click here to view the implementation
Each design pattern implementation is contained within its respective directory. To use a pattern:
- Navigate to the pattern's directory.
- Compile the Java files.
- Run the main program to see the pattern in action.
Contributions to add more design patterns or improve existing implementations are welcome! Feel free to fork this repository, make changes, and submit pull requests.
"Head First Design Patterns" by Eric Freeman, Elisabeth Robson, Bert Bates, and Kathy Sierra is a great resource for understanding design patterns in a fun and engaging way. This repository serves as a companion to the book, providing hands-on implementations of the discussed patterns.
Feel free to customize this README further according to your preferences, adding more details or sections as needed.