This is part 4 of my design patterns articles.
A lot of credit to Christopher Okhravi. I’m trying to cover all his videos about design patterns from the book “Head First: Design Patterns”.

The abstract pattern is very similar to the factory pattern, the only difference is that the abstract pattern includes more levels of abstraction.
As always, simple and short. Let’s do it!

We got UI that needs to be compatible with different operating systems — Mac and Linux. …


This is part 3 of my design patterns articles.
A lot of credit to Christopher Okhravi. I’m trying to cover all his videos about design patterns from the book “Head First: Design Patterns”.

Why factory pattern?
1. Sometimes the instantiation of a class is very complex.
2. Sometimes we will need some business logic on the instantiation of a class.
3. Sometimes we will need specific parameters to provide, or specific class instances to provide.
4. Polymorphism - Sometimes we will want to instantiate different classes on run time.

Let’s say our app is producing car insurances.
The app is working…


This is part 2 of my design patterns articles.
A lot of credit to Christopher Okhravi. I’m trying to cover all his videos about design patterns from the book “Head First: Design Patterns”.

Let’s think about a weather app.
The app got some weather class, which has a state of the current weather,
and once the weather changes/updates, all the dependent classes which need to “subscribe” to the weather, need to display the new updated weather.

Example to the interfaces:

The observable needs to notify the subscribers on every change of his state.
Therefor, the observable should have:

1- List…


At the beginning of my road as a developer, I found myself having a hard time to come up with good designs to my code.

As a junior developer at the time, I didn't knew much about strategy patterns, and only after I started to learn about it, I found out how much it could have made my life easier.

Easier not only by how the code looks, but it kind of forcing you to think MORE about what you need to do in the task, how to implement it, how it will be used, really think of the little…

Ilan Belfer

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