-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.

asked Feb 13, 2017 at 13:09
1

1 Answer 1

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.

answered Feb 13, 2017 at 13:29

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.