Design Principle 2

#Object Oriented Programming design principle

“Program to an interface, not an implementation.”1

The very purpose of creating an interface is to abstract away the unimportant details of implementation and to serve as the skeleton for the classes that implements it. Programming to an interface creates structures to your code as you write them and a great vantage point for others to understand the intent of the implementing class at a higher and less distracting level.

  1. Head First Design Pattern by Elisabeth Freeman and Kathy Sierra

    ↩︎