This may seem obvious to most people, but I'm just trying to confirm that Dependency Injection (DI) relies on the use of interfaces.
More specifically, in the case of a class that has a specific interface as a parameter in its constructor or a specific interface defined as a property (aka. Setter), the DI environment can pass an instance of a particular class to satisfy the needs of this Interface in this class. (Sorry if this description is not clear. I am having trouble describing this because the terminology / concepts are still somewhat new to me.)
The reason I'm asking is because I currently have a class that has a dependency. Not so much an object dependency as a URL. The class is as follows: [C #]:
using System.Web.Services.Protocols;
public partial class SomeLibraryService : SoapHttpClientProtocol
{
public SomeLibraryService()
{
this.Url = "http://MyDomainName.com:8080/library-service/jse";
}
}
The SoapHttpClientProtocol class has a Public property called Url(which is a plain old "string"), and the constructor here initializes it with a hard-coded value.
Can I use the DI framework to enter a different value when building? I do not think that since this.Urlit is not a type Interface; it is a String.
[, " wsdl", , . , , . , , .]
, , this.Url , , . (SoC),
?