Skip to main content
added 293 characters in body
Source Link
Tulains Córdova
  • 39.5k
  • 13
  • 99
  • 155

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions(***).

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

*** NOTE: In the context of SOLID and OOD, "abstration" means than it cannot be instantiated, like an abstract class or interface.

Something that cannot be instantiated needs to have very little reason to change overtime. That way code that depends on abstractions depend on things that are stable ( the what vs the how ). Code that depends on abstractions have less reason to change that code that depends on concretions.

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions(***).

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

*** NOTE: In the context of SOLID and OOD, "abstration" means than it cannot be instantiated, like an abstract class or interface.

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions(***).

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

*** NOTE: In the context of SOLID and OOD, "abstration" means than it cannot be instantiated, like an abstract class or interface.

Something that cannot be instantiated needs to have very little reason to change overtime. That way code that depends on abstractions depend on things that are stable ( the what vs the how ). Code that depends on abstractions have less reason to change that code that depends on concretions.

added 145 characters in body
Source Link
Tulains Córdova
  • 39.5k
  • 13
  • 99
  • 155

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions(***).

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

*** NOTE: In the context of SOLID and OOD, "abstration" means than it cannot be instantiated, like an abstract class or interface.

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions.

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions(***).

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

*** NOTE: In the context of SOLID and OOD, "abstration" means than it cannot be instantiated, like an abstract class or interface.

added 66 characters in body
Source Link
Tulains Córdova
  • 39.5k
  • 13
  • 99
  • 155

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions.

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions.

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

The main reason to use interfaces is explained in the dependency inversion principle ( the D in SOLID ).

  • High-level modules should not depend on low-level modules. Both should depend on abstractions.
  • Abstractions should not depend on details. Details should depend on abstractions.

The goal of this is decoupling the higher level from specific implementations, allowing for more maintainability.

Maintainability's main issue is compensate the unability of human beings to foresee the future.

Statements like "ClientA only uses ImplementerA and ClientB only use ImplementerB" has proven to not hold true forever.

Source Link
Tulains Córdova
  • 39.5k
  • 13
  • 99
  • 155
Loading