I'm working on a simple DI library, and on the subject of using services through interfaces, I can't find the usefulness. Perhaps it's because I dont fully or properly understand how an interface should be used during the process of injecting dependencies.
Here's what I (think I) understand:
DI consists primarily of clients and services. Interfaces allow the injector to tell the client which variables and methods are available through a specific service.
If that isn't wrong:
It seems to me that the interface could pass available property names and what type they are, so my client can know if they're functions or values, but that doesn't seem useful since I can do that with or without the interface. Whether the methods/values are utilized via an interface or via the injected service, I can know their types because I can use the
So I think that I must not have a proper understanding of what interfaces should do. How are interfaces used in dependency injection?