faif / python-patterns

A collection of design patterns/idioms in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing Implementor and Abstraction in Bridge Pattern

sheiun opened this issue · comments

hi @sheiun , thanks for the issue.

  1. In terms of the pattern: Abstraction/interface delegates the work to the implementation/platform.
    It is not about interfaces or abstract classes in any particular programming language.

  2. As I see it - it is not always necessary to create python ABC classes to emulate something like interface from other languages.

TLDR: don't see a problem here.

Thoughts?

One of the benefits of duck typing is that it doesn't force you to define interfaces for everything. You can still do it if you want with a module like abc as mentioned by @gyermolenko, but it's not mandatory. I also find the current implementation fine.