I often hear/read about interfaced based programming but I am not exactly clear on what that really means. Is interfaced based programming an actual stand alone topic that actually has books written about it? If so, can anyone recommend any good ones?
I came across interface based programming as I was reading about how good APIs are designed and would like to learn more about it. Right now I am not clear how to properly go about designing an API around interfaces.
Any info is greatly appreciated.
It's basically a matter of expressing your dependencies in terms of interfaces instead of concrete classes (or worse, static methods). So if one of your classes needs to perform authentication, it should be provided an IAuthenticator
(or whatever).
This means that:
See if these very popular discussions help:
What is the best analogy to help non-oop developers grok interface based programming?
Why would I want to use Interfaces?
When are interfaces needed?
When should one use interfaces?
What is the purpose of interfaces?
Good Case For Interfaces
What does it mean to “program to an interface”?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With