Skip to main content
2 of 3
deleted 1 characters in body
Jordão
  • 651
  • 6
  • 7

Even though you don't have explicit interfaces in dynamic languages, the dependency inversion principle can be followed by coding the client code against an abstract representation of the dependency, which the concrete "implementers" will adhere to via duck typing.

In a sense, that's the default in a dynamic language, and it could be argued that the dependency inversion principle is followed without any conscious effort. Although in practice it's worthwhile to consider the abstract representation of your concrete classes, to decouple from any implementation details that don't capture the essence of the abstraction.

Jordão
  • 651
  • 6
  • 7