Adapter pattern

October 04, 2014

Reading time ~1 minute

Adapter pattern is a structural design pattern that aims to adapt certain interface to some client needs that are expressed by another, different interface. This design pattern is very common in software engineering. It gives the bases of half a dozen similar patterns lying on the same concept - Strategy, Facade, Repository, etc.

Adapter pattern outside of Software Engineering

Adapter pattern is very common solution to many problems outside of Software Engineering, which is not much of a surprise since the concept of design patterns was invented long before software engineering even existed.

The incompatibility of European and US plug outlets is just one example of a case where Adapter pattern is used in everyday life.

Outlet example

Adapter pattern in Software Engineering

In Softare Engineering is the problem of adapting one interface to another is a common problem that Adapter pattern helps us to solve.

In its basic form the Adapter pattern consist of some Interface and Adapters that implement it. You could encounter various implementations of Adapter pattern. It could be implemented with a dynamic language as well.

I will give you an example of Adapter Pattern implementation using JavaScript and AngularJS. In this example we will adapt the $http service to some controllers using an api for adapter.

This very basic example that aims to give you just a basic understanding of one type of problems that Adapter pattern helps us solve.

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