In this post, we are going to learn the observer pattern and the usage of this design pattern.

Observer Design Pattern
Observer Design Pattern
Observer Design Pattern

Observer Design Pattern Definition

According to the GoF definition, observer pattern defines a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically. It is also referred to as the publish-subscribe pattern.

In simple words when you want to be aware of changes in another object probably you can use Observer Design Pattern.

The observer design pattern is a behavioral pattern and it means it is a pattern of communication between objects.

Other names of this design…

This is a summary of a few articles that you can find in the reference part.

0. Build and Test — Before Code Review

Use CI tools to check If tests are passing and the app can be built before starting the review process.

1. Use A Code Review Tool

Using these tools can save a lot of time. These tools can highlight changes and also you are able to interact with the developer or reviewer using these tools.

  1. Review Board
  2. Crucible
  3. GitHub
  4. Phabricator
  5. Collaborator
  6. CodeScene
  7. Visual Expert
  8. Gerrit
  9. Rhodecode
  10. Veracode
  11. Reviewable
  12. Peer Review for Trac

2. Set Early Expectations

The developer should annotate their source code before the review process. By having the authors carefully read through…

Authenticate Users with LinkedIn — NodeJS — Express
Authenticate Users with LinkedIn — NodeJS — Express
Step by step Guide to Authenticate Users with LinkedIn in your Express App

A few days ago I wanted to test the authentication using LinkedIn and there was no straight forward article to help me. So I decided to note down the steps in this article and I hope it would be helpful.

LinkedIn can be one of the Identity Providers of your application. We have seen this in lots of websites that let us login with our Google Account, Facebook account, or Github and LinkedIn. We want to do the same and let the user sign in with his/her LinkedIn account.

The Steps to authenticate users with LinkedIn

  • Create a LinkedIn app
  • Create an application that can authenticate users…

Load test using k6

What is load testing?

A load test is a type of software testing which is conducted to understand the behavior of the application under a specific expected load. Load testing is performed to determine a system’s behavior under both normal and at peak conditions(reference).

If you are not familiar with this type of test you should know that we always want to know the capability of our software and the number of online users that we can handle. …

Decorators in Typescript
Decorators in Typescript

What is a Decorator?

It is a structural design pattern that lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors (reference).

When we are using Typescript Method Decorators, they are higher-order functions that help us change method behavior or do something with the arguments.

Typescript method decorator definition: method decorator can be used to observe, modify, or replace a method definition (reference)

Now, let’s see how we can define a simple method decorator.


In order to run the Typescript code, we need to compile them using the Typescript compiler.

We need a tsconfig.json

First time using Deno

What is Deno?

A secure runtime for JavaScript and TypeScript.
Based on their website:
Deno is a simple, modern, and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

  1. Secure by default. No file, network, or environment access, unless explicitly enabled.
  2. Supports TypeScript out of the box.
  3. Ships only a single executable file.
  4. Has built-in utilities like a dependency inspector (deno info) and a code formatter (deno fmt).
  5. Has a set of reviewed (audited) standard modules that are guaranteed to work with Deno:

These were from Deno's official document.

Why Deno is created and who is the creator?

Deno is created by Ryan Dahl and he…

Testing NodeJS Express App
Testing NodeJS Express App
NodeJS Express Integration Test

What is an integration test?

“ Integration tests determine if independently developed units of software work correctly when they are connected to each other. The term has become blurred even by the diffuse standards of the software industry, so I’ve been wary of using it in my writing. In particular, many people assume integration tests are necessarily broad in scope, while they can be more effectively done with a narrower scope. “ Martin Fowler.

Testing an Express app

So as to see how we can test an Express app we need to create a simple Express application. I used MongoDB and its native driver(We usually use Mongoose as an…

and one practical real-world example

JavaScript Closures in Plain Language
JavaScript Closures in Plain Language

What are JavaScript closures?

It is a JavaScript feature that allows a function to access its outer function scope. Sounds complicated?

We can use this feature when we have nested functions like this:


What are streams?

Streams are a collection of data that might not be complete and we might not fit them in memory.

When we watch an online video we use a stream. Do we need to download the whole video to watch it? the answer is no. thus the video data is not complete but we can watch the parts we want!

Imagine we are uploading a video with 12GB size. The problem is our memory is only 4GB. So how is it possible to upload such a file? …

Debug files in Node.js without the use of ‘debugger’

NodeJs Built-in debugger
NodeJs Built-in debugger

Let’s imagine that I have a simple JavaScript file and I want to calculate the sum of integer numbers but I have a problem and I want to debug this file(but I don’t want to use console.log as a debugger!)

This is the file:

Poorshad Shaddel

Full Stack Developer at Telewebion.

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