Composition vs. inheritance in PHP

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 […]

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 […]

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 […]