Skip to content

ico12319/Design-Patterns-Examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here, you'll find simple and clear implementations of various design patterns. 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):

  1. Visitor pattern: The Visitor pattern lets you add further operations to objects without having to modify them. It's great for you need to perform different actions on a group of related objects.
  2. 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.
  3. 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.
  4. 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.
  5. Prototype pattern: The prototype design pattern lets us copy existing objects without making our code dependent on their classes.
  6. Builder: The Builder design pattern is a creational design pattern that allows us to create complex objects step by step. We use it when the desired object is complex and requires multiple steps to be created. In such case it is better to have multiple construction method then one huge constructor with many parameters. The builder keeps the object private until it is created.
  7. Adapter: The Adapter design pattern is a structural design pattern that allows objects with incompatible interfaces to collaborate.This design pattern allows us to create an adapter. This is a special object that converts the interface of one object so that another object can understand it.

About

Small collection of Design Patterns Examples (tasks done by me)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published