Here, you'll find simple and clear implementations of various design patterns in C++. Whether you're new to design patterns or just looking for some practical examples, this repo aims to help you understand and apply these concepts in your own projects. Included Design Patterns(for now):
- Visitor pattern: The Visitor pattern lets you add further operations to objects without having to modify them. It's great for when you need to perform different actions on a group of related objects.
- Composite pattern(Tree structure): The Composite pattern allows you to build tree structures of objects. This helps you work with these objects uniformly, whether you're dealing with a single object or a whole tree.
- Singleton: The Singleton pattern ensures that a class has only one instance and provides a global access point to it. Use this when you need a single point of control for a particular resource.
- Factory: The Factory Design Pattern is a creational pattern that provides a way to encapsulate the instantiation of objects. It defines an interface for creating an object, but lets subclasses alter the type of objects that will be created. This pattern is particularly useful when the exact type of object to be created isn’t known until runtime.
- Prototype pattern: The prototype design pattern lets us copy existing objects without making our code dependent on their classes.(most of the examplese in this repo)