B
B
BitNeBolt2020-10-18 10:27:45
Java
BitNeBolt, 2020-10-18 10:27:45

Why is this decorator method needed?

The source says that a decorator should have exactly the same method as a generic abstract class. Each new decorator, implementing the decorator class, overrides the getDescription method.

Why move this method into a decorator class?
5f8bee57b4645110424626.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton R., 2020-10-18
@BitNeBolt

In my opinion, everything is very clearly explained here: https://refactoring.guru/ru/design-patterns/decorator

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question