Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 642 Bytes

File metadata and controls

7 lines (4 loc) · 642 Bytes

Chapter 3: Decorator design pattern

Decorator: Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.

Not quite the same as python decorator syntax as in python you call the decorated function and the decorating function is called first whereas the decorating function must be called here.

I subclass ABC and used the @abstractmethod decorator from the abc module here but do not use any of this functionality - it just serves as documentation.