OOP vs. ECS

Kage - Shadow of the Ninja
Kage – Shadow of the Ninja

In recent years, Entity-Component Systems (ECS) has been recognized as the most notable architecture for game development. There are many good articles about the architecture that can be found on the Internet, some of them are:

Of course these articles are excellent and well-written, but one thing I don’t like about them is that they are not fair at comparing OOP and ECS. They think that class inheritance is fundamental to OOP thus they blame OOP in order to praise ECS as a preference of composition over inheritance.

Continue reading “OOP vs. ECS”

Advertisements

Decorator pattern: decorators still need to be reused

Russian Matroshka

An inherent concern of OO design: how can we extent a class without modifying its content? If we can do that, we satisfy the Open/Closed Principle (the O in SOLID).

Let’s take an example, a class Rectangle with a method draw:

Continue reading “Decorator pattern: decorators still need to be reused”