Design Patterns Examples

This repository contains implementations of various design patterns. Each branch corresponds to a different design pattern.

List of Branches and Design Patterns

  1. part1-factory-pattern

    • This branch includes an implementation of the Factory Pattern.
    • The Factory Pattern provides an interface for creating instances of a class, allowing subclasses to alter the type of objects that will be created.
  2. part2-builder-pattern

    • This branch demonstrates the Builder Pattern.
    • The Builder Pattern separates the construction of a complex object from its representation, allowing the same construction process to create different representations.
  3. part3-factory-method-pattern

    • This branch showcases the Factory Method Pattern.
    • The Factory Method Pattern defines an interface for creating an object but lets subclasses alter the type of objects that will be created.
  4. part4-prototype-pattern

    • This branch illustrates the Prototype Pattern.
    • The Prototype Pattern allows for creating new objects by copying an existing object, providing a more efficient way to create instances.
  5. part5-decorator-pattern

    • This branch implements the Decorator Pattern.
    • The Decorator Pattern attaches additional responsibilities to an object dynamically. It provides a flexible alternative to subclassing for extending functionality.
  6. part6-singleton-pattern

    • This branch demonstrates the Singleton Pattern.
    • The Singleton Pattern ensures that a class has only one instance and provides a global point of access to that instance.
  7. part7-adapter-pattern

    • This branch includes an implementation of the Adapter Pattern.
    • The Adapter Pattern allows incompatible interfaces to work together, acting as a bridge between them.
  8. part8-bridge-pattern

    • This branch showcases the Bridge Pattern.
    • The Bridge Pattern separates abstraction from implementation, allowing them to vary independently.
  9. part9-facade-pattern

    • This branch illustrates the Facade Pattern.
    • The Facade Pattern provides a unified interface to a set of interfaces in a subsystem, making it easier to use.

How to Use

  1. Clone the repository:

    git clone https://github.com/muminvarici/design-patterns.git
  2. Checkout the branch corresponding to the design pattern you want to explore:

    git checkout branch-name
  3. Explore the code and learn how each design pattern is implemented.

Feel free to reach out for any questions or clarifications.

Happy coding!