-3

Interface is used to implement more than one class but it doesn't have any code inside its methods... however the method that is called works with its respective function. Also, it gets very confusing when it is used in design patterns like facade. example: in case of PHP framework Laravel.

  • 3
    Possible duplicate of [What are the differences between abstract classes, interfaces, and when to use them](http://softwareengineering.stackexchange.com/questions/173518/what-are-the-differences-between-abstract-classes-interfaces-and-when-to-use-t) – gnat Feb 13 '17 at 13:11

1 Answers1

2

"Interface is used to implement". This is at best misleading and at worst just flat wrong. The whole point of interfaces is to abstract away the implementation. An interface works by providing a "contract" or agreement of sorts between the the client and the underlying implementation, as to what is available to be called, parameters required etc

In that way, the client and the implementation are not so tightly coupled together and are easier to change out.

Bradley Thomas
  • 5,090
  • 6
  • 17
  • 26