Inheritance. One of the four fundamental concepts in object oriented programming, by the book. Inheritance, encapsulation, polymorphism and abstraction. But, as you may have noticed, this concept is becoming increasingly unpopular as a useful concept in modern programming, particularly when it comes to maintaining large code bases for projects that last for years and have […]
PHP
Repository pattern explained with Laravel and NestJS examples
The repository pattern is one of the simplest patterns to implement in terms of code and abstraction complexity, but it is also one of the most misrepresented and misused concepts in real-world scenarios and applications. I’ll try to express my thoughts on this. The concept Let’s start with the repository concept. How it appears and […]
Data Transfer Objects in PHP
DTOs (Data Transfer Objects) are common building blocks in object oriented programming. They are already present in some frameworks in various programming languages, with very different implementations and use cases. However, in PHP, we almost always use Data Transfer Objects to keep and transport data between application processes and layers. Martin Fowler first introduced the […]
Unify Laravel API responses with custom Success and Error classes
When developing an API that is for internal use, meaning, the API will not be used by external clients and applications but only by one single domain/client, we rarely take care of unified format of responses, particularly for POST, PATCH and PUT requests. Also, not infrequently, we struggle with time and people during the development […]
Facade and Builder design patterns in PHP
Two more design pattern examples and quick explanations guys. Yes, I know, I promise that I’ll try to post more interesting stuff (and more often) in future articles, like “10 things you should know if you want to become a great developer”. Well guess what, good knowledge of the most common design patterns is definitely […]
The observer design pattern in PHP
The observer design pattern is a very common pattern in programming. The main idea behind it is creating a set of classes which will be most suitable to solve the issue of publish/subscribe kind of tasks. It is very possible that, working as a developer, you will come to a situation when one action of […]
Factory design pattern and its variations in PHP
One of the most used and most useful of all design patterns in software development is the factory design pattern. The factory belongs to the creational group of design patterns, so we can assume that we can use this pattern when our implementation classes are to complicated to be built in concrete use cases and […]
Strategy design pattern in PHP
Design patterns are usually one of the most interesting topics in software programming. Patterns, schemes, algorithms, they are software concepts and solutions for commonly occurring issues in software engineering which are created and designed to make the interaction between classes and objects better, smoother, more elegant and probably the most important, reusable. As interesting this […]
Re-index your Elasticsearch data with zero downtime
As I promised in my previous blog post, today I will explain how to re-index your Elasticsearch index data with zero downtime. As I elaborated in the previous blog post, using Elasticsearch as your primary data storage is probably not the best solution, so you should keep your data using more persistent friendly database system […]
How to re-index your Elasticsearch data with Laravel Command
Laravel is a very powerful PHP framework that is widely used for web based applications of any size. Personally, I can say that I’ve been using it for years for a lot of the projects I’ve been working on and I must say, it’s a powerful tool. The first time when one of the projects […]