Observer

Observer

Observer

Defines a one to many dependency between objects so that when one object changes state, all it's dependents are notified and updated automatically.
Read More...


Visitor

Visitor

Intent

Represents an operation to be performed on the elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates.
Read More...


Template Method

Template Method

Intent

Define the skeleton of an algorithm in an operation, deferring some steps to subclasses. Template method lets subclasses redefine certain steps of an algorithm without changing the algorithm's structure.
Read More...


Strategy

Strategy

Intent

Define a family of algorithms, encapsulate each one, and make them interchangable. Strategy lets the algorithm vary independently from clients that use it.
Read More...


State

State

Intent

Allow an object to alter it's hebavior when it's interna; state changes. The object will appear to change it's class.
Read More...


Singleton

Singleton

Intent

Ensure a class only has one instance, and provide a global point of access to it.
Read More...


Proxy

Proxy

Intent

Provide a surrogate or placeholder for another object to control access to it.
Read More...


Prototype

Prototype

Intent

Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Read More...


Memento

Memento

Intent

Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.
Read More...


Mediator

Mediator

Intent

Define an object that encapsulates how a set of objects interact. Mediator promotes loose coupling by keeping objects from referring to each other explicitly, and it lets you vary their interaction independently.
Read More...


Iterator

Iterator

Intent

Provide a way to access the elements of an aggregate object sequentially without exposing it's underlying representation.
Read More...


Interpreter

Interpreter

Intent

Given a language, defines a representation for it's grammar along with an interpreter that uses the representation to interpret sentences in the language.
Read More...


Flyweight

Flyweight

Intent

Use sharing to support large numbers of fine-grained objects efficiently.
Read More...


Factory Method

Factory Method

Intent

Define an interface for creating an object, but let the subclasses decide which class to instantiate. Factory method lets a class defer instantiation to subclasses.
Read More...


Facade

Facade

Intent

Provide a unified interface to a set of interfaces in a subsystem. Facade defines a higher-level interface that makes the subsystem easier to use.
Read More...


Decorator

Decorator

Intent

Attach additional responsibility to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
Read More...


Composite

Composite

Intent

Compose objects into tree structures to represent part-whole hierarchies. Composite clients treat individual objects and compositions of objects uniformaly.
Read More...


Command

Command

Intent

Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
Read More...


Chain Of Responsibility

Chain Of Responsibility

Intent

Avoid coupling the sender of a request to it's receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
Read More...


Builder

Builder

Intent

Separate the construction of a complex object from its representation so that the same construction process can create different representatives.
Read More...


Bridge

Bridge

Intent

Decouple an abstraction from its implementation so that the two can vary independently.
Read More...


Adapter

Adapter

Intent

Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn't othersie because of incompatible interfaces.
Read More...


Abstract Factory

Abstract Factory

Intent

Provide an interface for creating families of related or dependent objects without specifying their concrete class.
Read More...


Design Patterns Basics

Design Principles Basics

Designing object-oriented software is hard, and designing 'reusable' object-oriented software is even harder. You must find pertinent objects, factor them into classes with the correct granularity, define class interfaces and hierarchy, etc. Your design should be specific with problem at hand, but also general enough to address future requriments. This is where design patterns come into picture. This blog is based on Design Patterns by GOF.
Read More...


Object Oriented Design Principles

Object Oriented Design Principles

This blog is based on series of articles by Uncle Bob
Read More...


Refactoring

Refactoring

It's 2022, and I haven't written a single blog after I created this website! So here I am finally writing my second blog. As a natural extention of my first blog on how to write clean code, this blog is a summary on how to refactor code based on the book Refactoring by Martin Fowler
Read More...


Clean Code

Clean Code

While wondering about what I should write for my first ever tech blog, I figured why not go to the basics and apply the same principle here. So here I am talking about Clean Code and summarizing my learnings from Clean Code by Uncle Bob
Read More...