Skip to content

Latest commit

 

History

History
23 lines (12 loc) · 1.38 KB

README.md

File metadata and controls

23 lines (12 loc) · 1.38 KB

designPatterns

first exposure to design patterns, lets see how nice these paradigms are !!

Singleton: Ensures that a class has only one instance and provides a global point of access to it.

Factory: Provides an interface for creating objects, but allows subclasses to decide which class to instantiate.

Builder: Separates the construction of a complex object from its representation, allowing the same construction process to create different representations.

Observer: Defines a one-to-many dependency between objects, where changes in one object trigger updates to other dependent objects.

Decorator: Allows adding behavior to an object dynamically, by wrapping the original object in one or more decorator classes.

Adapter: Converts the interface of one class into another interface that clients expect, enabling classes with incompatible interfaces to work together.

Proxy: Provides a surrogate or placeholder for another object to control access to it.

Command: Encapsulates a request as an object, allowing parameterization of clients with different requests, queueing, or logging of requests, and supporting undoable operations.

Strategy: Defines a family of algorithms, encapsulates each one, and makes them interchangeable at runtime.

Template Method: Defines the skeleton of an algorithm in a method, allowing subclasses to redefine certain steps of the algorithm without changing its structure.