Template Design Pattern

November 21, 2014

Reading time ~1 minute

Template Design Pattern also called Template Method is one of the Behavioral Design Patterns. It is very common and well known way to reduce the possibility of having to do something many times in cases where you have implementations of very similar algorithms.

The Template Method should be use to implement invariant parts of an algorithm once and leave the subclasses to implement the behaviour that can very.

Implementation

The implementation is very simple. It requires an abstract class with methods handling the different steps of an algorithm by using methods that could be overridden by the subclasses and a template method which defines the skeleton of an algorithm.

The template method shouldn’t be overridden!

Concrete implementations of the abstract class will be needed as well.

Template Method

So, lets see simple implementation written in Java.

So, when you want to use your implementations just initialize them and call the templete method on the instance.

Release early, release often (REPO) strategies

In this post I will try to review some of the things that every company should do in order to have better product releases. Continue reading

New things in C# 6

Published on December 22, 2014

ECMAScript 6 - The new JavaScript Part 2

Published on December 07, 2014