Event Aggregator

Even though Event Aggregator could be termed as one of the lesser known patterns, the useful of the pattern cannot be ignored. In fact, it makes me wonder why it is lesser known. Let us recap the observer pattern. One of the problems with observer pattern is that it could grow out of hand when … Continue reading Event Aggregator

Gof : Observer Pattern

This has been a long overdue. I had started with this series of byte sized tutorials on various patterns but never went ahead and completed the series. So here am continuing from where I left with the Observer Pattern. While working with applications, there would times you could have an object which would like to notify other … Continue reading Gof : Observer Pattern

SOLID : Liskov Substitution Principle (Part 2)

In the first part of the post, we visited the core definition of Liskov Substitution principle and took time to understand the problem using an example. In this second part, we would take time to understand some of the governing rules of the principle. The rules that needs to be followed for LSP compliance can … Continue reading SOLID : Liskov Substitution Principle (Part 2)

SOLID : Liskov Substitution Principle (Part 1)

The "L" in SOLID stands for Liskov Substitution Principle, named after Barbara Liskov, who initially introduced in 1987 keynote address. LSP provides guidelines for creating inheritence heirachy where a client can use any class or subclass without breaking the expected behavior. We will begin by looking at the official definition first. If S is a … Continue reading SOLID : Liskov Substitution Principle (Part 1)

GOF: Composite Pattern

Composite Pattern, in a way, literally takes of from where Decorator Pattern ends. One might be inclined to think of it as a specialized case of Decorator Pattern which composes one or more instances of similiar objects and manipulate them uniformly. This allows the client to work on a single entity or composition of entity … Continue reading GOF: Composite Pattern

Law Of Demeter

If you ask any Software Developer, he would vouch that separation of concerns is the fundamental principles for maintaining any complex system and one of the vital links for achieving Separation of Concerns is decoupling. Law of Demeter (LoD), also known as Principle of least knowledge, intends to reduce coupling between objects as proposed by … Continue reading Law Of Demeter

Code Smells : Dispensable

Continuing on our discussion on Code Smells and Refactoring techniques, we will discuss Dispensable in this post. Dispensables are avoidable components whose absence would make the code much more cleaner, readable and efficient. Comments A joke is not a good one if needed to be explained. A similar philosophy holds for code as well. If … Continue reading Code Smells : Dispensable

Design Pattern : Memento Pattern

Memento Design Pattern allows to capture internal state of an object in an external object and restore it to the desired checkpoint when required, all the while being in compliance with encapsulation. The Memento Design Pattern comprises of 3 actor classes. Originator : The class which needs to have the ability to store its internal … Continue reading Design Pattern : Memento Pattern