Repository for learning design patterns. Implementation for learning design patterns based on the book: Head First Design Patterns by Eric Freeman, Elisabeth Robson, Bert Bates, Kathy Sierra.
- Defines a family of algorithms, encapsulates each one, and makes them interchangeable.
- Defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically.
- The Decorator Pattern attaches additional responsibilities to an object dynamically.
- Decorators provide a flexible alternative to subclassing for extending functionality.
- The Factory Method Pattern defines an interface for creating an object, but lets subclasses decide which class to instantiate. Factory method lets a class defer instantiation to subclasses.
- The Singleton Pattern ensures a class has only one instance, and provides a global point of access to it.
- Encapsulates a request as an object, thereby letting you parameterize other objects with different requests, queue or log requests, and support undoable operations.
- A new class that is neutral or does nothing. A null object is useful when you don't have a meaningful object to return, and yet you want to remove the responsibility for handling null from the client (Elminates the need for null checks etc).