Design Patterns : Template Method

The purpose of a Template Method Pattern is to define the skelton of an algorithm, while deferring the exact steps to sub classes. There is plenty of literature on the internet detailing the pattern, so we will skip it and head right to the code. As always, lets begin by defining the contract interface, in … Continue reading Design Patterns : Template Method

Design Patterns : Chain of Responsibility

The intend of Chain of Responibility Pattern is to avoid coupling the sender of a request to its reciever by giving more than one object change to handle the request. Let's try to mimic the execution of classical Waterfall Model with CoR. Let's begin by declaring the contract interface. And our sub classes. The final … Continue reading Design Patterns : Chain of Responsibility

Design Patterns : Fascade Pattern

Fascade, name being an analogy to an architectural fascade, intends set the tone for the entire functionality by providing a simplified yet effective interface wrapping away the complex, pooly designed collection of APIs. Wrong Code Consider following set of Classes.   The Client Code could be As you can see, the Client class is invoking … Continue reading Design Patterns : Fascade Pattern