How to allow objects with incompatible interfaces to collaborate.

Adapter Pattern is a way to organize your code to use a third-party library to compose features of your application. This pattern is also helpful when you want to have a feature abstraction, but you are using a code that you do not have access to or can’t modify.

What is Adapter?

The…

How to isolate different variants of an algorithm within an object using the Strategy Pattern

The Strategy Pattern is a popular design pattern used to organize as well as and encapsulate algorithms. This pattern is used when is necessary to isolate the business logic of a class from algorithm implementation details that may not be as important in the context of that logic.

What is Strategy?

The authors…

Creating a peer-to-peer connection to establish a video chat

Nowadays, more and more people are using online resources to communicate, giving presentations, working on projects or even creating music in online collaboration. Therefore, many tech companies are enhancing their services to provide a way to make this communication easy to scale, easy to use, more accessible, and more efficient.

How to create an object without exposing the creation logic

The Factory Pattern is one of the core design pattern principles for creating an object. It allows clients to create objects using a common interface. In TypeScript, there are many different ways in which you can use the factory pattern to make your code cleaner and more concise. …

How to define and maintain dependencies between objects

Also known as Dependents or Publish-Subscribe, the Observer pattern helps us create decoupled components and modules. It improves the testability, composition, and scalability of our applications. In this post, I’m going to show you some concepts around the Observer pattern, how it works, and a practical example.

What is Observer?

The authors of…

How to restrict the instantiation of a class to one object

Singleton is one of the most used design patterns in software development. In this post, we will learn how to implement this pattern in the context of web development using TypeScript.

What is Singleton?

The authors of the book Design Patterns: Elements of Reusable Object-Oriented Software defines Singleton Pattern as:

A singleton class…

AI Optimization Algorithm

The AC-3 algorithm simplifies a constraint satisfaction problem using the constraints to prune out values from the variables domain.

In this article, we will see how the AC-3 algorithm works and the implementation in Python.

How It Works

We can represent the AC-3 algorithm in 3 steps:

  1. Get all the constraints and turn…

Cesar William Alvarenga

Software Engineer

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