I think in section what if we want to add credit card payment? We might modify our code like this
not violates the Dependency Inversion a instead of it violates the Interface Segregation Principle and Open/Closed Principle 🤔
According to with example, you break down "Payment" interfaces into more granular and specific ones. Clients should implement only those methods that they really need and don't depend on methods they do not use. So that mean you already resolve problem with Interface Segregation Principle
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think in section
what if we want to add credit card payment? We might modify our code like this
not violates the
Dependency Inversion
a instead of it violates theInterface Segregation Principle
andOpen/Closed Principle
🤔According to with example, you break down "Payment" interfaces into more granular and specific ones. Clients should implement only those methods that they really need and don't depend on methods they do not use. So that mean you already resolve problem with
Interface Segregation Principle