January 2025
Intermediate to advanced
304 pages
8h 28m
English
Sometimes, we may want to add new behaviors for our objects but we don’t want this behavior on all instances of a class. They may even be just temporary behaviors that are added and removed dynamically. It may be a punctual feature triggered by a specific event. Or we may want our object to carry out its usual responsibilities with extra features during the game run. Well, usually when we face this kind of situation where we want to add new behaviors to an object in runtime, instead of having them statically set, we use the Decorator pattern.
The Decorator pattern is a structural pattern that allows us to wrap an object inside a decorator, and people often refer to it as a wrapper. The ...
Read now
Unlock full access