This repository is a collection of design patterns in object-oriented programming.
The repository is a work in progress and will be updated as I learn more about design patterns.
- Abstraction
- Encapsulation
- Polymorphism
- Inheritance
- Encapsulate what varies
- Favor composition over inheritance
- Program to an interface, not an implementation
- Strive for loosely coupled designs between objects that interact
- Classes should be open for extension but closed for modification
-
Strategy Pattern
- Define a family of algorithms, encapsulate each one, and make them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

-
Observer Pattern
- Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

-
Decorator Pattern
- Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

-
Factory Pattern
- Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses.
