Observer
28 Aug 2022Observer
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...
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...
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...
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...
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...
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...
Ensure a class only has one instance, and provide a global point of access to it.
Read More...
Provide a surrogate or placeholder for another object to control access to it.
Read More...
Specify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype.
Read More...
Without violating encapsulation, capture and externalize an object's internal state so that the object can be restored to this state later.
Read More...
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...
Provide a way to access the elements of an aggregate object sequentially without exposing it's underlying representation.
Read More...
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...
Use sharing to support large numbers of fine-grained objects efficiently.
Read More...
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...
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...
Attach additional responsibility to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
Read More...
Compose objects into tree structures to represent part-whole hierarchies. Composite clients treat individual objects and compositions of objects uniformaly.
Read More...
Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations.
Read More...
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...
Separate the construction of a complex object from its representation so that the same construction process can create different representatives.
Read More...
Decouple an abstraction from its implementation so that the two can vary independently.
Read More...
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...
Provide an interface for creating families of related or dependent objects without specifying their concrete class.
Read More...
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...
This blog is based on series of articles by Uncle Bob
Read More...
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...
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...