You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to rethink the future of the decorator pattern as it cannot work in the followin scenario: a decorated method calls a method of its decorated class which itself calls a class methods. The decorated class will never be able to call a decorated method and this may cause unexpected behaviour when decorator classes are used improperly.
The text was updated successfully, but these errors were encountered:
It is not clear how to remove the decorator pattern and try to have another strategy to achieve the same goal, i.e. add functionalities to a class method (e.g. before or after some other function calls) without necessarily rewrite/copy-paste the code and add other functionalities.
At present, the decorators are removed entirely, but this issue will remain open for keeping record of this and discuss possible solutions.
A tentative implementation of a new decorator pattern is available here claudiofantacci@4f0966d
The result, however, is way too complicated and requires developers to adopt specific implementation policy in some derived classes. As a consequence, I confirm that I'm removing the decorator pattern entirely.
We need to rethink the future of the decorator pattern as it cannot work in the followin scenario: a decorated method calls a method of its decorated class which itself calls a class methods. The decorated class will never be able to call a decorated method and this may cause unexpected behaviour when decorator classes are used improperly.
The text was updated successfully, but these errors were encountered: