lmmx / tap

dex ⠶ tap – an audio transcriber for web radio
MIT License
1 stars 0 forks source link

Favour composition over inheritance for Stream #15

Open lmmx opened 3 years ago

lmmx commented 3 years ago

(Note: after review, this may end up indicating beeb’s interface is the one to edit)

Following the guide here: https://python-patterns.guide/gang-of-four/composition-over-inheritance/

Solution # 1: The Adapter Pattern Solution # 2: The Bridge Pattern Solution # 3: The Decorator Pattern Solution # 4: Beyond the Gang of Four patterns Dodge: “if” statements Dodge: Multiple Inheritance Dodge: Mixins Dodge: Building classes dynamically’

I prefer the ‘bridge’ pattern, and suggest switching to that: supplying a handler class from which the other methods would acquire their action from (TODO: review)