The Godfather is one of the very first novels I properly made the effort to read. It was also my introduction to American Mafia and it’s prevalence during the early 20th century.

The American Mafia, commonly referred to in North America as “the Mafia” or sometimes “the Mob”, or the Italian-American Mafia, is a highly organised Italian-American criminal society and criminal organisation.

Ever since, I have pretty much watched all the mafia movies ever made. So hypothetically, if I were to create a crime family, I’d go about it the object oriented way.

Let’s get crackin’

The American Mafia operates on a strict…

What you see above is pretty close to heaven for a guitarist. I have been playing guitar myself for over a decade now. I started out with a cheap acoustic guitar, played every song I could on it for around 3 years

But no matter what song is played, the sound of an acoustic guitar has its limits. You can’t make it sound louder beyond a point of heavy strumming, you can’t make the notes sustain long enough and you definitely can’t do this.

So after some protest and struggle, I convinced my parents to buy my first electric guitar

Came across some dusty old school notebooks while cleaning today. Upon opening them, I wasn’t surprised to see random games of tic-tac-toe between notes.

And so, I got my “real world thing” for today.

Noughts and Crosses

A game for two players, X and O, who take turns marking the spaces in a 3×3 grid. The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.

Let’s get crackin’

Whenever it comes to board games, the first thing that comes to mind is ways to win.

To say it in one word; strategy.

In order to win…

Today, I was woken up by a thunderous sound. This is not unusual as I live close to the airport. As I tried to go back to sleep, I thought to myself, would it be such a problem if all flights started operations after noon? Wouldn’t be nice to have this control over them?

And so, I got my “real world thing” for today.

Air Traffic Control

Air traffic control (ATC) is a service provided by ground-based air traffic controllers who direct aircraft on the ground and through controlled airspace, and can provide advisory services to aircraft in non-controlled airspace.

Without ATC, communication…

As a learning exercise, I have decided to go on walks (in the outside world) to kill boredom, pick one “real world thing” and redesign it in the object oriented way to the best of my abilities, as a series of articles.

To put it plainly, the object-orient­ed paradigm is one that is based on the idea that everything that exists has some data and exhibits certain behaviour based on that data.

Today’s walk was more of a mundane chore, as I had run out of groceries. …

Don’t keep reinventing the wheel.

If a particular problem keeps reappearing, instead of an on the spot solution, we will come up with a standard operating procedure to cover it. This is where design patterns come into the picture.

Before diving into these design patterns let’s take a look at the their origin.

Gang of Four

Wheel reinvention is a constant problem for software engineers. It is not that we like repeating things but just that we subconsciously end up being redundant.

Sometimes when we are designing applications it is hard to realise that the circular friction reduction device with a central axis…

Code quality is directly impacts how maintainable inheritance hierarchies and modules are. Following techniques make life easier when writing code which shares inherited behaviour.

Recognise the Antipatterns

There are antipatterns that indicate that our code might need inheritance.

  1. An object using a variable with a name like type or category to determine what message to send to self will lead to maintenance nightmares, as every addition of a new type will lead to code change.
    The solution is to refactor the code to implement inheritance by moving the common code in an abstract superclass and creating subclasses for the different…

Understanding Roles

Some problems require sharing behaviour among unrelated objects. This common behaviour is basically a role an object plays. Many of the roles needed by an application are obvious during the design phase, but it is also common to discover new roles during development.

Discovering Roles

We often end up discovering roles which require not only specific message signatures, but also specific behaviour. When a role needs shared behaviour we’re faced with the problem of organising the shared code.

Ideally this code would be defined in a single place but be usable by any object that wished to act…

Nitish Sharma

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store