-
Couldn't load subscription status.
- Fork 150
Open
Description
I believe this requires some refactoring that might slightly modify the public interfaces, but for a good cause: depedency injection and inversion of control concepts.
For instance, instead of
var request = new GeocodingRequest();
request.Address = "1600 Amphitheatre Parkway";
request.Sensor = false;
var response = new GeocodingService().GetResponse(request);
DI friendly public interfaces would make the following code, which is much more DI friendly itself:
public class Consumer
{
private IGeocodingService _GeocodingService;
public Consumer(IGeocodingService GeocodingService) { ... }
public void DoWork()
{
IGeocodingRequest request = _GeocodingService.CreateRequest();
request.Address = "1600 Amphitheatre Parkway";
var response = _GeocodingService.GetResponse(request);
}
}
Metadata
Metadata
Assignees
Labels
No labels