I am developing web application for almost 5 years and still I did not know what is the use case of interface. I think many developers like me do not know the actual use case of interface. So I am here to share with you the actual use case of interface.
You know that we can not define object from a interface. But interface gives us a polymorphic object. This content helps me a lot to learn interface though this content Why And When To Use Interface In Laravel Application
is on Laravel based but the concept is good.
Actually interface gives us 100% data abstraction. Abstract class also give that abstraction but not 100%. When we need a polymorphic object then you can use interface in your application.
If you follow this content, hope you will learn new things and your doubt about interface will be clear.
Top comments (0)